)]}'
{"/PATCHSET_LEVEL":[{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"11b1fab4faa935ea56d644284912457b8585faea","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"b089af63_fb6b77cb","updated":"2025-10-14 21:00:52.000000000","message":"this little snippet is very old:\n\n```\n^001407b96 (Chuck Thier        2010-07-12 17:03:45 -0500   51) def teardown_module():\n^001407b96 (Chuck Thier        2010-07-12 17:03:45 -0500   52)     \"clean up my monkey patching\"\n```\n\nit was probably needed at some point when try/finally patching was the norm before mock.patch was more common, or maybe even just considered \"belts and braces\" for the time?\n\nPresumably it\u0027s been harmless, but for some reason I don\u0027t yet fully understand it\u0027s started to cause some test coupling failures.\n\nOn master:\n```\nvagrant@saio:~$ pytest swift/test/unit/common/test_db_replicator.py::TestReplicatorSync::test_local_ids swift/test/unit/container/test_replicator.py::TestReplicatorSync::test_choose_replication_mode_warning_for_old_peer\n\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d test session starts \u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\nplatform linux -- Python 3.10.12, pytest-8.4.1, pluggy-1.6.0 -- /usr/bin/python3\ncachedir: .pytest_cache\nrootdir: /home/vagrant/swift\nconfigfile: tox.ini\nplugins: subtests-0.14.2, cov-6.2.1\ncollected 2 items                                                                                                                                                                                                                                      \n\nswift/test/unit/common/test_db_replicator.py::TestReplicatorSync::test_local_ids PASSED                                                                                                                                                          [ 50%]\nswift/test/unit/container/test_replicator.py::TestReplicatorSync::test_choose_replication_mode_warning_for_old_peer FAILED                                                                                                                       [100%]\n\n\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d FAILURES \u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\n_________________________________________________________________________________________ TestReplicatorSync.test_choose_replication_mode_warning_for_old_peer _________________________________________________________________________________________\n\nself \u003d \u003ctest.unit.container.test_replicator.TestReplicatorSync testMethod\u003dtest_choose_replication_mode_warning_for_old_peer\u003e\n\n    def test_choose_replication_mode_warning_for_old_peer(self):\n        daemon \u003d replicator.ContainerReplicator({}, logger\u003dself.logger)\n    \n        broker \u003d mock.Mock()\n        broker.db_file \u003d \u0027/path/to/db\u0027\n        broker.path \u003d \u0027/v1/AUTH_a/c\u0027\n        broker.sharding_initiated.return_value \u003d False\n    \n        node \u003d {\u0027ip\u0027: \u002710.0.0.2\u0027, \u0027port\u0027: 6201, \u0027device\u0027: \u0027sdb1\u0027}\n        http \u003d mock.Mock()\n        rinfo \u003d {}  # no \u0027shard_max_row\u0027\n        info \u003d {\u0027id\u0027: \u0027local-uuid\u0027}\n        local_sync \u003d mock.Mock()\n        different_region \u003d False\n    \n        with mock.patch.object(daemon, \u0027_sync_shard_ranges\u0027) as mock_sync, \\\n             mock.patch.object(db_replicator.Replicator,\n                               \u0027_choose_replication_mode\u0027,\n                               return_value\u003dTrue) as mock_choose_repl_mode:\n\u003e           daemon._choose_replication_mode(\n                node, rinfo, info, local_sync, broker, http, different_region)\n\nswift/test/unit/container/test_replicator.py:163: \n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ \nswift/swift/container/replicator.py:166: in _choose_replication_mode\n    success \u003d super(ContainerReplicator, self)._choose_replication_mode(\nswift/swift/common/db_replicator.py:571: in _choose_replication_mode\n    if self._in_sync(rinfo, info, broker, local_sync):\n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ \n\nself \u003d \u003cswift.container.replicator.ContainerReplicator object at 0x7f1ba911b820\u003e, rinfo \u003d {}, info \u003d {\u0027id\u0027: \u0027local-uuid\u0027}, broker \u003d \u003cMock id\u003d\u0027139756777352128\u0027\u003e, local_sync \u003d \u003cMock id\u003d\u0027139756777355056\u0027\u003e\n\n    def _in_sync(self, rinfo, info, broker, local_sync):\n        \"\"\"\n        Determine whether or not two replicas of a databases are considered\n        to be in sync.\n    \n        :param rinfo: remote database info\n        :param info: local database info\n        :param broker: database broker object\n        :param local_sync: cached last sync point between replicas\n    \n        :returns: boolean indicating whether or not the replicas are in sync\n        \"\"\"\n\u003e       if max(rinfo[\u0027point\u0027], local_sync) \u003e\u003d info[\u0027max_row\u0027]:\nE       KeyError: \u0027point\u0027\n\nswift/swift/common/db_replicator.py:492: KeyError\n----------------------------------------------------------------------------------------------------------------- Captured stdout call -----------------------------------------------------------------------------------------------------------------\ntest WARNING: unable to replicate shard ranges to peer 10.0.0.2:6201/sdb1; peer may need upgrading, path: /v1/AUTH_a/c, db: /path/to/db\n\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d short test summary info \u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\nFAILED swift/test/unit/container/test_replicator.py::TestReplicatorSync::test_choose_replication_mode_warning_for_old_peer - KeyError: \u0027point\u0027\n\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d 1 failed, 1 passed in 0.41s \u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\n```\n\nThis change:\n```\nvagrant@saio:~$ pytest swift/test/unit/common/test_db_replicator.py::TestReplicatorSync::test_local_ids swift/test/unit/container/test_replicator.py::TestReplicatorSync::test_choose_replication_mode_warning_for_old_peer\n\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d test session starts \u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\nplatform linux -- Python 3.10.12, pytest-8.4.1, pluggy-1.6.0 -- /usr/bin/python3\ncachedir: .pytest_cache\nrootdir: /home/vagrant/swift\nconfigfile: tox.ini\nplugins: subtests-0.14.2, cov-6.2.1\ncollected 2 items                                                                                                                                                                                                                                      \n\nswift/test/unit/common/test_db_replicator.py::TestReplicatorSync::test_local_ids PASSED                                                                                                                                                          [ 50%]\nswift/test/unit/container/test_replicator.py::TestReplicatorSync::test_choose_replication_mode_warning_for_old_peer PASSED                                                                                                                       [100%]\n\n\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d 2 passed in 0.23s \u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\n```\n\nIt\u0027s possible that \"removing the reload fixes the problem\" is indicating some new and exciting as of yet undiscovered test coupling?  But I haven\u0027t found any evidence of that yet and none of our other test modules do this:\n\n```\ncgerrard@NVStation:~/Workspace/vagrant-swift-all-in-one/swift$ ag teardown_module test/unit/\ntest/unit/common/test_db_replicator.py\n51:def teardown_module():\n```\n\n\"If it hurts don\u0027t do it!\"\n\nMaybe it\u0027s some weird interaction with the timing of superclass mocking in container.test_replicator constructors?  Very strange... maybe I\u0027ll keep thinking about it or someone else will find another clue.\n\n... but in the meantime the diff seems reasonable to me on the surface and it would be helpful for anyone who can currently reproduce the failure on master.","commit_id":"df8da9382bc3a0170f8d29f062e7b4e6309e4c05"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"b79837d9ba14648e64e8da669a8141ae2353d8ea","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":3,"id":"83aa5825_d0d4d36b","updated":"2025-10-27 17:29:25.000000000","message":"My first encounter with this change coming back from a break was very \"did you even run this!?\"\n\n```\nvagrant@saio:~$ pytest swift/test/unit/container/test_replicator.py  -vsx\n\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d test session starts \u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\nplatform linux -- Python 3.10.12, pytest-8.4.1, pluggy-1.6.0 -- /usr/bin/python3\ncachedir: .pytest_cache\nrootdir: /home/vagrant/swift\nconfigfile: tox.ini\nplugins: subtests-0.14.2, cov-6.2.1\ncollected 78 items                                                                                                               \n\nswift/test/unit/container/test_replicator.py::TestReplicatorSync::test_choose_replication_mode_sharded_nothing_more_to_replicate test WARNING: unable to replicate shard ranges to peer 10.0.0.2:6201/sdb1; peer may need upgrading, path: AUTH_a/c, db: /mnt/tmp/tmpn24rh8j4/sda/containers/0/321/e15d22b387f5996d038a88a74ff9f321/e15d22b387f5996d038a88a74ff9f321.db\ntest DEBUG: sharded and has nothing more to replicate to peer 10.0.0.2:6201/sdb1, path: AUTH_a/c, db: /mnt/tmp/tmpn24rh8j4/sda/containers/0/321/e15d22b387f5996d038a88a74ff9f321/e15d22b387f5996d038a88a74ff9f321.db\nFAILED\n\n\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d FAILURES \u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\n_______________________ TestReplicatorSync.test_choose_replication_mode_sharded_nothing_more_to_replicate ________________________\n\nself \u003d \u003ctest.unit.container.test_replicator.TestReplicatorSync testMethod\u003dtest_choose_replication_mode_sharded_nothing_more_to_replicate\u003e\n\n    def tearDown(self):\n        super().tearDown()\n        if db_replicator.ReplConnection !\u003d self.original_repl_connection:\n\u003e           self.fail(\u0027ReplConnection was not restored\u0027)\nE           AssertionError: ReplConnection was not restored\n\nswift/test/unit/container/test_replicator.py:60: AssertionError\n\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d short test summary info \u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\nFAILED swift/test/unit/container/test_replicator.py::TestReplicatorSync::test_choose_replication_mode_sharded_nothing_more_to_replicate - AssertionError: ReplConnection was not restored\n!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! stopping after 1 failures !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d 1 failed in 0.34s \u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\n\n```\n\nFor some reason it works when you give it `--pdb`\n\n```\nvagrant@saio:~$ pytest swift/test/unit/container/test_replicator.py  --pdb\n...\n\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d 78 passed, 12 subtests passed in 4.48s \u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\nvagrant@saio:~$ \n```","commit_id":"3a9479e23523af5db2c75c2178556cdc1900331e"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"6a8428f4634daafb4cd39d44a3fb265b05e7fa15","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":4,"id":"e8d95af1_4ad03d09","updated":"2025-10-28 15:16:53.000000000","message":"I did want to point out that on master it failed with `.unitests` so although we had a subset of tests in `test/unit/container/test_replicator.py` failing we are trying to polish `test/unit/common/test_db_replicator.py`","commit_id":"f256bc7eb385d8d80c2ce2aa26e270171d9164a1"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"3399a76ae19ee931c3b1ab3762e6c802ec5b8bb6","unresolved":true,"context_lines":[],"source_content_type":"","patch_set":4,"id":"9a89a839_85eb2dd4","updated":"2025-10-28 15:01:37.000000000","message":"LGTM!!\nAfter the patch is checked out:\n```\npytest test/unit/container/test_replicator.py\n\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d test session starts \u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\nplatform linux -- Python 3.10.12, pytest-8.4.2, pluggy-1.6.0 -- /usr/bin/python3\ncachedir: .pytest_cache\nrootdir: /vagrant/swift\nconfigfile: tox.ini\nplugins: cov-7.0.0, subtests-0.15.0\ncollected 78 items\n\ntest/unit/container/test_replicator.py::TestReplicatorSync::test_choose_replication_mode_sharded_nothing_more_to_replicate PASSED          [  1%]\ntest/unit/container/test_replicator.py::TestReplicatorSync::test_choose_replication_mode_warning_for_old_peer PASSED                       [  2%]\ntest/unit/container/test_replicator.py::TestReplicatorSync::test_clean_up_after_deleted_brokers PASSED                                     [  3%]\ntest/unit/container/test_replicator.py::TestReplicatorSync::test_cleanup_post_replicate PASSED                                             [  5%]\ntest/unit/container/test_replicator.py::TestReplicatorSync::test_delete_db_logs_on_sync_store_error PASSED                                 [  6%]\ntest/unit/container/test_replicator.py::TestReplicatorSync::test_diff_capped_sync PASSED                                                   [  7%]\ntest/unit/container/test_replicator.py::TestReplicatorSync::test_find_local_handoff_for_part PASSED                                        [  8%]\ntest/unit/container/test_replicator.py::TestReplicatorSync::test_local_ids PASSED                                                          [ 10%]\ntest/unit/container/test_replicator.py::TestReplicatorSync::test_misplaced_rows_replicate_and_enqueue PASSED                               [ 11%]\ntest/unit/container/test_replicator.py::TestReplicatorSync::test_misplaced_rows_replicate_and_enqueue_from_old_style_shard PASSED          [ 12%]\ntest/unit/container/test_replicator.py::TestReplicatorSync::test_misplaced_rows_replicate_and_enqueue_from_shard PASSED                    [ 14%]\ntest/unit/container/test_replicator.py::TestReplicatorSync::test_multiple_out_sync_reconciler_enqueue_normalize PASSED                     [ 15%]\ntest/unit/container/test_replicator.py::TestReplicatorSync::test_post_replicate_hook PASSED                                                [ 16%]\ntest/unit/container/test_replicator.py::TestReplicatorSync::test_replication_local_sharded_remote_missing PASSED                           [ 17%]\ntest/unit/container/test_replicator.py::TestReplicatorSync::test_replication_local_sharded_remote_sharded PASSED                           [ 19%]\ntest/unit/container/test_replicator.py::TestReplicatorSync::test_replication_local_sharded_remote_sharded_large_diff PASSED                [ 20%]\ntest/unit/container/test_replicator.py::TestReplicatorSync::test_replication_local_sharded_remote_sharding PASSED                          [ 21%]\ntest/unit/container/test_replicator.py::TestReplicatorSync::test_replication_local_sharded_remote_sharding_large_diff PASSED               [ 23%]\ntest/unit/container/test_replicator.py::TestReplicatorSync::test_replication_local_sharded_remote_unsharded PASSED                         [ 24%]\ntest/unit/container/test_replicator.py::TestReplicatorSync::test_replication_local_sharded_remote_unsharded_large_diff PASSED              [ 25%]\ntest/unit/container/test_replicator.py::TestReplicatorSync::test_replication_local_sharding_remote_missing PASSED                          [ 26%]\ntest/unit/container/test_replicator.py::TestReplicatorSync::test_replication_local_sharding_remote_missing_large_diff PASSED               [ 28%]\ntest/unit/container/test_replicator.py::TestReplicatorSync::test_replication_local_sharding_remote_presharding PASSED                      [ 29%]\ntest/unit/container/test_replicator.py::TestReplicatorSync::test_replication_local_sharding_remote_presharding_large_diff PASSED           [ 30%]\ntest/unit/container/test_replicator.py::TestReplicatorSync::test_replication_local_sharding_remote_sharding PASSED                         [ 32%]\ntest/unit/container/test_replicator.py::TestReplicatorSync::test_replication_local_sharding_remote_sharding_large_diff PASSED              [ 33%]\ntest/unit/container/test_replicator.py::TestReplicatorSync::test_replication_local_sharding_remote_unsharded PASSED                        [ 34%]\ntest/unit/container/test_replicator.py::TestReplicatorSync::test_replication_local_sharding_remote_unsharded_large_diff PASSED             [ 35%]\ntest/unit/container/test_replicator.py::TestReplicatorSync::test_replication_local_unsharded_remote_missing PASSED                         [ 37%]\ntest/unit/container/test_replicator.py::TestReplicatorSync::test_replication_local_unsharded_remote_sharded PASSED                         [ 38%]\ntest/unit/container/test_replicator.py::TestReplicatorSync::test_replication_local_unsharded_remote_sharded_large_diff PASSED              [ 39%]\ntest/unit/container/test_replicator.py::TestReplicatorSync::test_replication_rsync_then_merge_aborts_after_merge_sharded PASSED            [ 41%]\ntest/unit/container/test_replicator.py::TestReplicatorSync::test_replication_rsync_then_merge_aborts_after_merge_sharding PASSED           [ 42%]\ntest/unit/container/test_replicator.py::TestReplicatorSync::test_replication_rsync_then_merge_aborts_before_merge_sharded PASSED           [ 43%]\ntest/unit/container/test_replicator.py::TestReplicatorSync::test_replication_rsync_then_merge_aborts_before_merge_sharding PASSED          [ 44%]\ntest/unit/container/test_replicator.py::TestReplicatorSync::test_replicator_sync PASSED                                                    [ 46%]\ntest/unit/container/test_replicator.py::TestReplicatorSync::test_report_up_to_date PASSED                                                  [ 47%]\ntest/unit/container/test_replicator.py::TestReplicatorSync::test_rsync_failure PASSED                                                      [ 48%]\ntest/unit/container/test_replicator.py::TestReplicatorSync::test_rsync_then_merge PASSED                                                   [ 50%]\ntest/unit/container/test_replicator.py::TestReplicatorSync::test_sync_bogus_db_quarantines PASSED                                          [ 51%]\ntest/unit/container/test_replicator.py::TestReplicatorSync::test_sync_local_create_policy_over_newer_remote_create PASSED                  [ 52%]\ntest/unit/container/test_replicator.py::TestReplicatorSync::test_sync_local_create_policy_over_newer_remote_delete PASSED                  [ 53%]\ntest/unit/container/test_replicator.py::TestReplicatorSync::test_sync_local_create_policy_over_older_remote_delete PASSED                  [ 55%]\ntest/unit/container/test_replicator.py::TestReplicatorSync::test_sync_local_half_delete_policy_over_newer_remote_create PASSED             [ 56%]\ntest/unit/container/test_replicator.py::TestReplicatorSync::test_sync_local_recreate_policy_over_newer_remote_create PASSED                [ 57%]\ntest/unit/container/test_replicator.py::TestReplicatorSync::test_sync_local_recreate_policy_over_newer_remote_delete PASSED                [ 58%]\ntest/unit/container/test_replicator.py::TestReplicatorSync::test_sync_local_recreate_policy_over_older_remote_create PASSED                [ 60%]\ntest/unit/container/test_replicator.py::TestReplicatorSync::test_sync_local_recreate_policy_over_older_remote_delete PASSED                [ 61%]\ntest/unit/container/test_replicator.py::TestReplicatorSync::test_sync_local_recreate_policy_over_older_remote_recreate PASSED              [ 62%]\ntest/unit/container/test_replicator.py::TestReplicatorSync::test_sync_merge_timestamps PASSED                                              [ 64%]\ntest/unit/container/test_replicator.py::TestReplicatorSync::test_sync_remote_can_not_keep_up PASSED                                        [ 65%]\ntest/unit/container/test_replicator.py::TestReplicatorSync::test_sync_remote_create_policy_over_newer_local_create PASSED                  [ 66%]\ntest/unit/container/test_replicator.py::TestReplicatorSync::test_sync_remote_create_policy_over_newer_local_delete PASSED                  [ 67%]\ntest/unit/container/test_replicator.py::TestReplicatorSync::test_sync_remote_create_policy_over_older_local_delete PASSED                  [ 69%]\ntest/unit/container/test_replicator.py::TestReplicatorSync::test_sync_remote_half_delete_policy_over_newer_local_create PASSED             [ 70%]\ntest/unit/container/test_replicator.py::TestReplicatorSync::test_sync_remote_in_sync PASSED                                                [ 71%]\ntest/unit/container/test_replicator.py::TestReplicatorSync::test_sync_remote_missing PASSED                                                [ 73%]\ntest/unit/container/test_replicator.py::TestReplicatorSync::test_sync_remote_missing_most_rows PASSED                                      [ 74%]\ntest/unit/container/test_replicator.py::TestReplicatorSync::test_sync_remote_missing_one_rows PASSED                                       [ 75%]\ntest/unit/container/test_replicator.py::TestReplicatorSync::test_sync_remote_recreate_policy_over_newer_local_create PASSED                [ 76%]\ntest/unit/container/test_replicator.py::TestReplicatorSync::test_sync_remote_recreate_policy_over_newer_local_delete PASSED                [ 78%]\ntest/unit/container/test_replicator.py::TestReplicatorSync::test_sync_remote_recreate_policy_over_older_local_create PASSED                [ 79%]\ntest/unit/container/test_replicator.py::TestReplicatorSync::test_sync_remote_recreate_policy_over_older_local_delete PASSED                [ 80%]\ntest/unit/container/test_replicator.py::TestReplicatorSync::test_sync_remote_recreate_policy_over_older_local_recreate PASSED              [ 82%]\ntest/unit/container/test_replicator.py::TestReplicatorSync::test_sync_remote_with_timings PASSED                                           [ 83%]\ntest/unit/container/test_replicator.py::TestReplicatorSync::test_sync_shard_ranges PASSED                                                  [ 84%]\ntest/unit/container/test_replicator.py::TestReplicatorSync::test_sync_shard_ranges_error PASSED                                            [ 85%]\ntest/unit/container/test_replicator.py::TestReplicatorSync::test_sync_shard_ranges_logs_via_db_log_debug PASSED                            [ 87%]\ntest/unit/container/test_replicator.py::TestReplicatorSync::test_sync_shard_ranges_merge_remote_osr\ntest/unit/container/test_replicator.py::TestReplicatorSync::test_sync_shard_ranges_merge_remote_osr PASSED                                 [ 88%]\ntest/unit/container/test_replicator.py::TestReplicatorSync::test_sync_shard_ranges_none_to_sync PASSED                                     [ 89%]\ntest/unit/container/test_replicator.py::TestReplicatorSync::test_sync_shard_ranges_timeout_in_fetch PASSED                                 [ 91%]\ntest/unit/container/test_replicator.py::TestReplicatorSync::test_sync_shard_ranges_trouble_receiving_so_none_to_sync PASSED                [ 92%]\ntest/unit/container/test_replicator.py::TestReplicatorSync::test_sync_shard_ranges_with_rsync PASSED                                       [ 93%]\ntest/unit/container/test_replicator.py::TestReplicatorSync::test_sync_status_change PASSED                                                 [ 94%]\ntest/unit/container/test_replicator.py::TestReplicatorSync::test_sync_to_remote_with_misplaced PASSED                                      [ 96%]\ntest/unit/container/test_replicator.py::TestReplicatorSync::test_sync_triggers_sync_store_update PASSED                                    [ 97%]\ntest/unit/container/test_replicator.py::TestReplicatorSync::test_update_sync_store PASSED                                                  [ 98%]\ntest/unit/container/test_replicator.py::TestReplicatorSync::test_update_sync_store_exception PASSED                                        [100%]\n\n\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d 78 passed, 12 subtests passed in 3.70s \u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\n```\n\n@alistairncoles@gmail.com had concerns about how we aren\u0027t being consistent in mocking within `test/unit/container/test_replicator.py`, would you be open to squashing those changes into this patch as well ? ref: https://review.opendev.org/c/openstack/swift/+/964056/1/test/unit/container/test_replicator.py","commit_id":"f256bc7eb385d8d80c2ce2aa26e270171d9164a1"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"ec0654b9f331df7dc54d97110325c5bdf4fd7549","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":4,"id":"4efc0884_f5c695b7","updated":"2025-11-03 14:46:58.000000000","message":"On master I see two tests fail, apparently due to coupling:\n\n```\n$ pytest test/unit/common/test_db_replicator.py test/unit/container/test_replicator.py\n\nFAILED test/unit/container/test_replicator.py::TestReplicatorSync::test_choose_replication_mode_warning_for_old_peer - KeyError: \u0027point\u0027\nFAILED test/unit/container/test_replicator.py::TestReplicatorSync::test_delete_db_logs_on_sync_store_error - AssertionError: Expected \u0027delete_db\u0027 to be called once. Called 0 times.\n```\n\nwith this patch all looks good.\n\nIIUC the problem was the reloading of the ``db_replicator`` module. I can get the flakey tests to fail again by reloading ``db_replicator`` much closer to the failing test assertion:\n\n```\ndiff --git a/test/unit/container/test_replicator.py b/test/unit/container/test_replicator.py\nindex 9a49892c3..8f55e1089 100644\n--- a/test/unit/container/test_replicator.py\n+++ b/test/unit/container/test_replicator.py\n@@ -142,6 +142,9 @@ class TestReplicatorSync(test_db_replicator.TestReplicatorSync):\n              % node_str], lines)\n \n     def test_choose_replication_mode_warning_for_old_peer(self):\n+        import importlib\n+        importlib.reload(db_replicator)\n+\n         daemon \u003d replicator.ContainerReplicator({}, logger\u003dself.logger)\n \n         broker \u003d mock.Mock()\n\n```\n\nMy *hunch* is that the implementation of ``replicator.ContainerReplicator`` has already been loaded, before the ``db_replicator module`` is reloaded, such that subsequently mocking the ``db_replicator`` module is ineffectual because it\u0027s not mocking the existent implementation of ``replicator.ContainerReplicator``.\n\nI can get that test to pass again if I also reload ``replicator``\n\n```\ndiff --git a/test/unit/container/test_replicator.py b/test/unit/container/test_replicator.py\nindex 9a49892c3..72cf094b5 100644\n--- a/test/unit/container/test_replicator.py\n+++ b/test/unit/container/test_replicator.py\n@@ -142,6 +142,10 @@ class TestReplicatorSync(test_db_replicator.TestReplicatorSync):\n              % node_str], lines)\n \n     def test_choose_replication_mode_warning_for_old_peer(self):\n+        import importlib\n+        importlib.reload(db_replicator)\n+        importlib.reload(replicator)\n+\n         daemon \u003d replicator.ContainerReplicator({}, logger\u003dself.logger)\n \n         broker \u003d mock.Mock()\n\n```","commit_id":"f256bc7eb385d8d80c2ce2aa26e270171d9164a1"}],"test/unit/common/test_db_replicator.py":[{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"3399a76ae19ee931c3b1ab3762e6c802ec5b8bb6","unresolved":false,"context_lines":[{"line_number":2378,"context_line":"        self.logger \u003d debug_logger()"},{"line_number":2379,"context_line":""},{"line_number":2380,"context_line":"    def tearDown(self):"},{"line_number":2381,"context_line":"        db_replicator.ReplConnection \u003d self._orig_ReplConnection"},{"line_number":2382,"context_line":"        db_replicator.ring.Ring \u003d self._orig_Ring"},{"line_number":2383,"context_line":"        rmtree(self.root)"},{"line_number":2384,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"a0ee2303_2d79b40c","side":"PARENT","line":2381,"updated":"2025-10-28 15:01:37.000000000","message":"argh!","commit_id":"48a5d5e42f017ab1438fcb257cfc53d3818f1b02"},{"author":{"_account_id":34892,"name":"ASHWIN A NAIR","display_name":"indianwhocodes","email":"nairashwin952013@gmail.com","username":"indianwhocodes","status":"Nvidia"},"change_message_id":"3399a76ae19ee931c3b1ab3762e6c802ec5b8bb6","unresolved":false,"context_lines":[{"line_number":2364,"context_line":"            self.root, self.datadir, self.backend, mount_check\u003dFalse,"},{"line_number":2365,"context_line":"            logger\u003ddebug_logger())"},{"line_number":2366,"context_line":"        FakeReplConnection \u003d attach_fake_replication_rpc(self.rpc)"},{"line_number":2367,"context_line":"        p \u003d mock.patch.object(db_replicator, \u0027ReplConnection\u0027,"},{"line_number":2368,"context_line":"                              FakeReplConnection)"},{"line_number":2369,"context_line":"        p.start()"},{"line_number":2370,"context_line":"        # it turns out this works very well, even if a test leaks a global"}],"source_content_type":"text/x-python","patch_set":4,"id":"bbef6ed2_856c8a9d","line":2367,"updated":"2025-10-28 15:01:37.000000000","message":"I didn\u0027t even know that in this particular unit-test we had a manual monkey-patching of `db_replicator.ReplConnection` and we removed `teardown_module()` at L51 which was an overkill since my understanding is that it reinitializes all the globals and disturbed the way we mocked f\u0027n\u0027s inside the tests:\n```\nFAILED container/test_replicator.py::TestReplicatorSync::test_choose_replication_mode_warning_for_old_peer - KeyError: \u0027point\u0027\nFAILED container/test_replicator.py::TestReplicatorSync::test_delete_db_logs_on_sync_store_error - AssertionError: Expected \u0027delete_db\u0027 to be called once. Called 0 times\n```","commit_id":"f256bc7eb385d8d80c2ce2aa26e270171d9164a1"}]}
