)]}'
{"test/probe/test_account_reaper.py":[{"author":{"_account_id":4608,"name":"Kota Tsuyuzaki","email":"bloodeagle40234@gmail.com","username":"tsuyuzaki-kota"},"change_message_id":"f6812fdb489a8d64231864e744faa43c6b199f03","unresolved":false,"context_lines":[{"line_number":152,"context_line":"    def test_delayed_reap(self):"},{"line_number":153,"context_line":"        def get_account_reapers(delay):"},{"line_number":154,"context_line":"            reapers \u003d []"},{"line_number":155,"context_line":"            for file in os.listdir(\u0027/etc/swift/account-server/\u0027):"},{"line_number":156,"context_line":"                if not file.endswith(\u0027.conf\u0027):"},{"line_number":157,"context_line":"                    continue"},{"line_number":158,"context_line":"                file \u003d \u0027/etc/swift/account-server/\u0027 + file"},{"line_number":159,"context_line":"                conf \u003d utils.readconf(file, \u0027account-reaper\u0027)"},{"line_number":160,"context_line":"                if delay:"},{"line_number":161,"context_line":"                    conf[\u0027delay_reaping\u0027] \u003d delay"},{"line_number":162,"context_line":"                reapers.append(reaper.AccountReaper(conf))"}],"source_content_type":"text/x-python","patch_set":2,"id":"9abb7d3a_9e6e73ff","line":159,"range":{"start_line":155,"start_character":0,"end_line":159,"end_character":61},"updated":"2016-05-31 04:54:41.000000000","message":"To be robust for any changes or dir based config, we should \n\nretrieves the configs from server settings likely:\n\n for server in Manager([\u0027account-reaper\u0027]).servers:\n     conf_file \u003d server.conf_files()\n     conf \u003d utils.readconf(conf_file, \u0027account-reaper\u0027)\n\n\nor\n\n for conf_file in self.configs[\u0027account-server\u0027].values():\n     conf \u003d utils.readconf(conf_file, \u0027account-reaper\u0027)","commit_id":"9984397218c8475c7203e366cd0f60e7061c1f9c"},{"author":{"_account_id":8330,"name":"Doron Chen","email":"cdoron@il.ibm.com","username":"cdoron"},"change_message_id":"3abd447e8650e0af8f39cfb949ed9c0d36a45f4f","unresolved":false,"context_lines":[{"line_number":152,"context_line":"    def test_delayed_reap(self):"},{"line_number":153,"context_line":"        def get_account_reapers(delay):"},{"line_number":154,"context_line":"            reapers \u003d []"},{"line_number":155,"context_line":"            for file in os.listdir(\u0027/etc/swift/account-server/\u0027):"},{"line_number":156,"context_line":"                if not file.endswith(\u0027.conf\u0027):"},{"line_number":157,"context_line":"                    continue"},{"line_number":158,"context_line":"                file \u003d \u0027/etc/swift/account-server/\u0027 + file"},{"line_number":159,"context_line":"                conf \u003d utils.readconf(file, \u0027account-reaper\u0027)"},{"line_number":160,"context_line":"                if delay:"},{"line_number":161,"context_line":"                    conf[\u0027delay_reaping\u0027] \u003d delay"},{"line_number":162,"context_line":"                reapers.append(reaper.AccountReaper(conf))"}],"source_content_type":"text/x-python","patch_set":2,"id":"9abb7d3a_97cdb15f","line":159,"range":{"start_line":155,"start_character":0,"end_line":159,"end_character":61},"in_reply_to":"9abb7d3a_9e6e73ff","updated":"2016-05-31 08:31:29.000000000","message":"Done","commit_id":"9984397218c8475c7203e366cd0f60e7061c1f9c"},{"author":{"_account_id":4608,"name":"Kota Tsuyuzaki","email":"bloodeagle40234@gmail.com","username":"tsuyuzaki-kota"},"change_message_id":"f6812fdb489a8d64231864e744faa43c6b199f03","unresolved":false,"context_lines":[{"line_number":159,"context_line":"                conf \u003d utils.readconf(file, \u0027account-reaper\u0027)"},{"line_number":160,"context_line":"                if delay:"},{"line_number":161,"context_line":"                    conf[\u0027delay_reaping\u0027] \u003d delay"},{"line_number":162,"context_line":"                reapers.append(reaper.AccountReaper(conf))"},{"line_number":163,"context_line":"            return reapers"},{"line_number":164,"context_line":""},{"line_number":165,"context_line":"        all_objects \u003d []"}],"source_content_type":"text/x-python","patch_set":2,"id":"9abb7d3a_29d75324","line":162,"updated":"2016-05-31 04:54:41.000000000","message":"It might be better to think of injecting a custom conf via Manager/Server implementation that the probe tests uses currently instead of making instances inside of this class. It may need more hack for them though. Or, if the delay reaping conf is off in conf file, just skipping this test may be enough?","commit_id":"9984397218c8475c7203e366cd0f60e7061c1f9c"},{"author":{"_account_id":8330,"name":"Doron Chen","email":"cdoron@il.ibm.com","username":"cdoron"},"change_message_id":"3abd447e8650e0af8f39cfb949ed9c0d36a45f4f","unresolved":false,"context_lines":[{"line_number":159,"context_line":"                conf \u003d utils.readconf(file, \u0027account-reaper\u0027)"},{"line_number":160,"context_line":"                if delay:"},{"line_number":161,"context_line":"                    conf[\u0027delay_reaping\u0027] \u003d delay"},{"line_number":162,"context_line":"                reapers.append(reaper.AccountReaper(conf))"},{"line_number":163,"context_line":"            return reapers"},{"line_number":164,"context_line":""},{"line_number":165,"context_line":"        all_objects \u003d []"}],"source_content_type":"text/x-python","patch_set":2,"id":"9abb7d3a_b7271511","line":162,"in_reply_to":"9abb7d3a_29d75324","updated":"2016-05-31 08:31:29.000000000","message":"get_account_reapers is only called once, with the \u00275\u0027 parameter. I removed the \"if delay:\" line. I hope you would find this acceptable.","commit_id":"9984397218c8475c7203e366cd0f60e7061c1f9c"},{"author":{"_account_id":4608,"name":"Kota Tsuyuzaki","email":"bloodeagle40234@gmail.com","username":"tsuyuzaki-kota"},"change_message_id":"f6812fdb489a8d64231864e744faa43c6b199f03","unresolved":false,"context_lines":[{"line_number":188,"context_line":""},{"line_number":189,"context_line":"        t \u003d time.time()"},{"line_number":190,"context_line":"        with mock.patch(\u0027swift.common.direct_client.time\u0027,"},{"line_number":191,"context_line":"                        mock.MagicMock(side_effect\u003d16 * [t])):"},{"line_number":192,"context_line":"            for node in nodes:"},{"line_number":193,"context_line":"                direct_delete_account(node, part, self.account)"},{"line_number":194,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"9abb7d3a_24d77a24","line":191,"updated":"2016-05-31 04:54:41.000000000","message":"Can i avoid mock.patch and use some sleep (e.g. time.sleep()) functions instead? The reason for this is that the probe should run against to actual existing environment, IMO. If it\u0027s ok to use a mock, it seems ok just in unit test.","commit_id":"9984397218c8475c7203e366cd0f60e7061c1f9c"},{"author":{"_account_id":8330,"name":"Doron Chen","email":"cdoron@il.ibm.com","username":"cdoron"},"change_message_id":"3abd447e8650e0af8f39cfb949ed9c0d36a45f4f","unresolved":false,"context_lines":[{"line_number":188,"context_line":""},{"line_number":189,"context_line":"        t \u003d time.time()"},{"line_number":190,"context_line":"        with mock.patch(\u0027swift.common.direct_client.time\u0027,"},{"line_number":191,"context_line":"                        mock.MagicMock(side_effect\u003d16 * [t])):"},{"line_number":192,"context_line":"            for node in nodes:"},{"line_number":193,"context_line":"                direct_delete_account(node, part, self.account)"},{"line_number":194,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"9abb7d3a_32905343","line":191,"in_reply_to":"9abb7d3a_24d77a24","updated":"2016-05-31 08:31:29.000000000","message":"Done","commit_id":"9984397218c8475c7203e366cd0f60e7061c1f9c"},{"author":{"_account_id":4608,"name":"Kota Tsuyuzaki","email":"bloodeagle40234@gmail.com","username":"tsuyuzaki-kota"},"change_message_id":"f6812fdb489a8d64231864e744faa43c6b199f03","unresolved":false,"context_lines":[{"line_number":198,"context_line":"        # reap after 9 seconds, and make sure that nothing is reaped"},{"line_number":199,"context_line":"        with mock.patch(\u0027swift.account.reaper.time\u0027,"},{"line_number":200,"context_line":"                        mock.MagicMock(side_effect\u003d64 * [t + 9])):"},{"line_number":201,"context_line":"            for account_reaper in account_reapers:"},{"line_number":202,"context_line":"                account_reaper.run_once()"},{"line_number":203,"context_line":""},{"line_number":204,"context_line":"        for policy, container, obj in all_objects:"}],"source_content_type":"text/x-python","patch_set":2,"id":"9abb7d3a_8442a60e","line":201,"updated":"2016-05-31 04:54:41.000000000","message":"If account_reapers is empty, no account-reaper won\u0027t run here so we may need an assertion like, somewhere:\n\n self.assertNotEqual(0, len(account_reapers),\n                     \u0027Config for account-reaper was not found\u0027)","commit_id":"9984397218c8475c7203e366cd0f60e7061c1f9c"},{"author":{"_account_id":8330,"name":"Doron Chen","email":"cdoron@il.ibm.com","username":"cdoron"},"change_message_id":"3abd447e8650e0af8f39cfb949ed9c0d36a45f4f","unresolved":false,"context_lines":[{"line_number":198,"context_line":"        # reap after 9 seconds, and make sure that nothing is reaped"},{"line_number":199,"context_line":"        with mock.patch(\u0027swift.account.reaper.time\u0027,"},{"line_number":200,"context_line":"                        mock.MagicMock(side_effect\u003d64 * [t + 9])):"},{"line_number":201,"context_line":"            for account_reaper in account_reapers:"},{"line_number":202,"context_line":"                account_reaper.run_once()"},{"line_number":203,"context_line":""},{"line_number":204,"context_line":"        for policy, container, obj in all_objects:"}],"source_content_type":"text/x-python","patch_set":2,"id":"9abb7d3a_12938f50","line":201,"in_reply_to":"9abb7d3a_8442a60e","updated":"2016-05-31 08:31:29.000000000","message":"Done","commit_id":"9984397218c8475c7203e366cd0f60e7061c1f9c"},{"author":{"_account_id":4608,"name":"Kota Tsuyuzaki","email":"bloodeagle40234@gmail.com","username":"tsuyuzaki-kota"},"change_message_id":"f6812fdb489a8d64231864e744faa43c6b199f03","unresolved":false,"context_lines":[{"line_number":210,"context_line":"                                          container)"},{"line_number":211,"context_line":"                except ClientException as err:"},{"line_number":212,"context_line":"                    self.fail(\"Nothing should reaped. Object should exist\")"},{"line_number":213,"context_line":"                else:"},{"line_number":214,"context_line":"                    pass"},{"line_number":215,"context_line":""},{"line_number":216,"context_line":"            object_ring \u003d POLICIES.get_object_ring(policy.idx, \u0027/etc/swift/\u0027)"},{"line_number":217,"context_line":"            part, nodes \u003d object_ring.get_nodes(self.account, container, obj)"}],"source_content_type":"text/x-python","patch_set":2,"id":"9abb7d3a_a491aa54","line":214,"range":{"start_line":213,"start_character":15,"end_line":214,"end_character":24},"updated":"2016-05-31 04:54:41.000000000","message":"Looks redundant. We don\u0027t have to put else statement if there is nothing to do.","commit_id":"9984397218c8475c7203e366cd0f60e7061c1f9c"},{"author":{"_account_id":8330,"name":"Doron Chen","email":"cdoron@il.ibm.com","username":"cdoron"},"change_message_id":"3abd447e8650e0af8f39cfb949ed9c0d36a45f4f","unresolved":false,"context_lines":[{"line_number":210,"context_line":"                                          container)"},{"line_number":211,"context_line":"                except ClientException as err:"},{"line_number":212,"context_line":"                    self.fail(\"Nothing should reaped. Object should exist\")"},{"line_number":213,"context_line":"                else:"},{"line_number":214,"context_line":"                    pass"},{"line_number":215,"context_line":""},{"line_number":216,"context_line":"            object_ring \u003d POLICIES.get_object_ring(policy.idx, \u0027/etc/swift/\u0027)"},{"line_number":217,"context_line":"            part, nodes \u003d object_ring.get_nodes(self.account, container, obj)"}],"source_content_type":"text/x-python","patch_set":2,"id":"9abb7d3a_b2a443a6","line":214,"range":{"start_line":213,"start_character":15,"end_line":214,"end_character":24},"in_reply_to":"9abb7d3a_a491aa54","updated":"2016-05-31 08:31:29.000000000","message":"Done","commit_id":"9984397218c8475c7203e366cd0f60e7061c1f9c"},{"author":{"_account_id":4608,"name":"Kota Tsuyuzaki","email":"bloodeagle40234@gmail.com","username":"tsuyuzaki-kota"},"change_message_id":"f6812fdb489a8d64231864e744faa43c6b199f03","unresolved":false,"context_lines":[{"line_number":213,"context_line":"                else:"},{"line_number":214,"context_line":"                    pass"},{"line_number":215,"context_line":""},{"line_number":216,"context_line":"            object_ring \u003d POLICIES.get_object_ring(policy.idx, \u0027/etc/swift/\u0027)"},{"line_number":217,"context_line":"            part, nodes \u003d object_ring.get_nodes(self.account, container, obj)"},{"line_number":218,"context_line":"            headers \u003d {\u0027X-Backend-Storage-Policy-Index\u0027: int(policy)}"},{"line_number":219,"context_line":"            for node in nodes:"}],"source_content_type":"text/x-python","patch_set":2,"id":"9abb7d3a_2493fa50","line":216,"updated":"2016-05-31 04:54:41.000000000","message":"\"policy.object_ring\" seems easy way to access the ring.","commit_id":"9984397218c8475c7203e366cd0f60e7061c1f9c"},{"author":{"_account_id":8330,"name":"Doron Chen","email":"cdoron@il.ibm.com","username":"cdoron"},"change_message_id":"3abd447e8650e0af8f39cfb949ed9c0d36a45f4f","unresolved":false,"context_lines":[{"line_number":213,"context_line":"                else:"},{"line_number":214,"context_line":"                    pass"},{"line_number":215,"context_line":""},{"line_number":216,"context_line":"            object_ring \u003d POLICIES.get_object_ring(policy.idx, \u0027/etc/swift/\u0027)"},{"line_number":217,"context_line":"            part, nodes \u003d object_ring.get_nodes(self.account, container, obj)"},{"line_number":218,"context_line":"            headers \u003d {\u0027X-Backend-Storage-Policy-Index\u0027: int(policy)}"},{"line_number":219,"context_line":"            for node in nodes:"}],"source_content_type":"text/x-python","patch_set":2,"id":"9abb7d3a_f2f36b9c","line":216,"in_reply_to":"9abb7d3a_2493fa50","updated":"2016-05-31 08:31:29.000000000","message":"Done","commit_id":"9984397218c8475c7203e366cd0f60e7061c1f9c"},{"author":{"_account_id":4608,"name":"Kota Tsuyuzaki","email":"bloodeagle40234@gmail.com","username":"tsuyuzaki-kota"},"change_message_id":"f6812fdb489a8d64231864e744faa43c6b199f03","unresolved":false,"context_lines":[{"line_number":222,"context_line":"                                      container, obj, headers\u003dheaders)"},{"line_number":223,"context_line":"                except ClientException as err:"},{"line_number":224,"context_line":"                    self.fail(\"Nothing should reaped. Object should exist\")"},{"line_number":225,"context_line":"                else:"},{"line_number":226,"context_line":"                    pass"},{"line_number":227,"context_line":""},{"line_number":228,"context_line":"        # run replicators and updaters"},{"line_number":229,"context_line":"        self.get_to_final_state()"}],"source_content_type":"text/x-python","patch_set":2,"id":"9abb7d3a_a49fea4e","line":226,"range":{"start_line":225,"start_character":0,"end_line":226,"end_character":24},"updated":"2016-05-31 04:54:41.000000000","message":"Same as L214","commit_id":"9984397218c8475c7203e366cd0f60e7061c1f9c"},{"author":{"_account_id":8330,"name":"Doron Chen","email":"cdoron@il.ibm.com","username":"cdoron"},"change_message_id":"3abd447e8650e0af8f39cfb949ed9c0d36a45f4f","unresolved":false,"context_lines":[{"line_number":222,"context_line":"                                      container, obj, headers\u003dheaders)"},{"line_number":223,"context_line":"                except ClientException as err:"},{"line_number":224,"context_line":"                    self.fail(\"Nothing should reaped. Object should exist\")"},{"line_number":225,"context_line":"                else:"},{"line_number":226,"context_line":"                    pass"},{"line_number":227,"context_line":""},{"line_number":228,"context_line":"        # run replicators and updaters"},{"line_number":229,"context_line":"        self.get_to_final_state()"}],"source_content_type":"text/x-python","patch_set":2,"id":"9abb7d3a_d2ee27b3","line":226,"range":{"start_line":225,"start_character":0,"end_line":226,"end_character":24},"in_reply_to":"9abb7d3a_a49fea4e","updated":"2016-05-31 08:31:29.000000000","message":"Done","commit_id":"9984397218c8475c7203e366cd0f60e7061c1f9c"},{"author":{"_account_id":4608,"name":"Kota Tsuyuzaki","email":"bloodeagle40234@gmail.com","username":"tsuyuzaki-kota"},"change_message_id":"f6812fdb489a8d64231864e744faa43c6b199f03","unresolved":false,"context_lines":[{"line_number":238,"context_line":"                                          container)"},{"line_number":239,"context_line":"                except ClientException as err:"},{"line_number":240,"context_line":"                    self.fail(\"Nothing should reaped. Container should exist\")"},{"line_number":241,"context_line":"                else:"},{"line_number":242,"context_line":"                    pass"},{"line_number":243,"context_line":""},{"line_number":244,"context_line":"            object_ring \u003d POLICIES.get_object_ring(policy.idx, \u0027/etc/swift/\u0027)"},{"line_number":245,"context_line":"            part, nodes \u003d object_ring.get_nodes(self.account, container, obj)"}],"source_content_type":"text/x-python","patch_set":2,"id":"9abb7d3a_84e8e6b5","line":242,"range":{"start_line":241,"start_character":0,"end_line":242,"end_character":24},"updated":"2016-05-31 04:54:41.000000000","message":"Same and a few same statements in following codes.","commit_id":"9984397218c8475c7203e366cd0f60e7061c1f9c"},{"author":{"_account_id":8330,"name":"Doron Chen","email":"cdoron@il.ibm.com","username":"cdoron"},"change_message_id":"3abd447e8650e0af8f39cfb949ed9c0d36a45f4f","unresolved":false,"context_lines":[{"line_number":238,"context_line":"                                          container)"},{"line_number":239,"context_line":"                except ClientException as err:"},{"line_number":240,"context_line":"                    self.fail(\"Nothing should reaped. Container should exist\")"},{"line_number":241,"context_line":"                else:"},{"line_number":242,"context_line":"                    pass"},{"line_number":243,"context_line":""},{"line_number":244,"context_line":"            object_ring \u003d POLICIES.get_object_ring(policy.idx, \u0027/etc/swift/\u0027)"},{"line_number":245,"context_line":"            part, nodes \u003d object_ring.get_nodes(self.account, container, obj)"}],"source_content_type":"text/x-python","patch_set":2,"id":"9abb7d3a_72365b53","line":242,"range":{"start_line":241,"start_character":0,"end_line":242,"end_character":24},"in_reply_to":"9abb7d3a_84e8e6b5","updated":"2016-05-31 08:31:29.000000000","message":"Done","commit_id":"9984397218c8475c7203e366cd0f60e7061c1f9c"},{"author":{"_account_id":4608,"name":"Kota Tsuyuzaki","email":"bloodeagle40234@gmail.com","username":"tsuyuzaki-kota"},"change_message_id":"f6812fdb489a8d64231864e744faa43c6b199f03","unresolved":false,"context_lines":[{"line_number":282,"context_line":"                    self.assertEqual(err.http_status, 404)"},{"line_number":283,"context_line":"                else:"},{"line_number":284,"context_line":"                    self.fail(\u0027Found un-reaped /%s/%s/%s on %r in %s!\u0027 %"},{"line_number":285,"context_line":"                              (self.account, container, obj, node, policy))"},{"line_number":286,"context_line":""},{"line_number":287,"context_line":"        # run replicators and updaters"},{"line_number":288,"context_line":"        self.get_to_final_state()"}],"source_content_type":"text/x-python","patch_set":2,"id":"9abb7d3a_be78972c","line":285,"updated":"2016-05-31 04:54:41.000000000","message":"My SAIO set up fails at this line because of using dir based config (e.g. /etc/swift/account/1.conf.d) that means account_reapers will be empty list.","commit_id":"9984397218c8475c7203e366cd0f60e7061c1f9c"},{"author":{"_account_id":8330,"name":"Doron Chen","email":"cdoron@il.ibm.com","username":"cdoron"},"change_message_id":"3abd447e8650e0af8f39cfb949ed9c0d36a45f4f","unresolved":false,"context_lines":[{"line_number":282,"context_line":"                    self.assertEqual(err.http_status, 404)"},{"line_number":283,"context_line":"                else:"},{"line_number":284,"context_line":"                    self.fail(\u0027Found un-reaped /%s/%s/%s on %r in %s!\u0027 %"},{"line_number":285,"context_line":"                              (self.account, container, obj, node, policy))"},{"line_number":286,"context_line":""},{"line_number":287,"context_line":"        # run replicators and updaters"},{"line_number":288,"context_line":"        self.get_to_final_state()"}],"source_content_type":"text/x-python","patch_set":2,"id":"9abb7d3a_521077a8","line":285,"in_reply_to":"9abb7d3a_be78972c","updated":"2016-05-31 08:31:29.000000000","message":"I hope that following the changes you suggested for get_account_reapers(), the test will no longer fail.","commit_id":"9984397218c8475c7203e366cd0f60e7061c1f9c"},{"author":{"_account_id":4608,"name":"Kota Tsuyuzaki","email":"bloodeagle40234@gmail.com","username":"tsuyuzaki-kota"},"change_message_id":"828ede2e8d11118c9a33441a0d91546ce67cbade","unresolved":false,"context_lines":[{"line_number":152,"context_line":"            reapers \u003d []"},{"line_number":153,"context_line":"            for conf_file in self.configs[\u0027account-server\u0027].values():"},{"line_number":154,"context_line":"                conf \u003d utils.readconf(conf_file, \u0027account-reaper\u0027)"},{"line_number":155,"context_line":"                conf[\u0027delay_reaping\u0027] \u003d delay"},{"line_number":156,"context_line":"                reapers.append(reaper.AccountReaper(conf))"},{"line_number":157,"context_line":"            return reapers"},{"line_number":158,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"9abb7d3a_d960d0d1","line":155,"updated":"2016-06-01 06:54:32.000000000","message":"It looks okay to me. Good catch.","commit_id":"fc3514174e0de527d12a46ea6eda0873b30a4e9c"},{"author":{"_account_id":4608,"name":"Kota Tsuyuzaki","email":"bloodeagle40234@gmail.com","username":"tsuyuzaki-kota"},"change_message_id":"828ede2e8d11118c9a33441a0d91546ce67cbade","unresolved":false,"context_lines":[{"line_number":158,"context_line":""},{"line_number":159,"context_line":"        all_objects \u003d []"},{"line_number":160,"context_line":"        # upload some containers"},{"line_number":161,"context_line":"        for policy in ENABLED_POLICIES:"},{"line_number":162,"context_line":"            container \u003d \u0027container-%s-%s\u0027 % (policy.name, uuid.uuid4())"},{"line_number":163,"context_line":"            client.put_container(self.url, self.token, container,"},{"line_number":164,"context_line":"                                 headers\u003d{\u0027X-Storage-Policy\u0027: policy.name})"}],"source_content_type":"text/x-python","patch_set":5,"id":"9abb7d3a_a2dddae1","line":161,"updated":"2016-06-01 06:54:32.000000000","message":"Oh yeah, the reason why you got None from policy.object_ring is because the ring not loaded. Probably, calling \n\n policy.load_ring(\u0027/etc/swift\u0027)\n\nhere is a solution to avoid POLICIES.get_object_ring.","commit_id":"fc3514174e0de527d12a46ea6eda0873b30a4e9c"},{"author":{"_account_id":8330,"name":"Doron Chen","email":"cdoron@il.ibm.com","username":"cdoron"},"change_message_id":"8887c2f466101953c1c04605cce726c9ab629564","unresolved":false,"context_lines":[{"line_number":158,"context_line":""},{"line_number":159,"context_line":"        all_objects \u003d []"},{"line_number":160,"context_line":"        # upload some containers"},{"line_number":161,"context_line":"        for policy in ENABLED_POLICIES:"},{"line_number":162,"context_line":"            container \u003d \u0027container-%s-%s\u0027 % (policy.name, uuid.uuid4())"},{"line_number":163,"context_line":"            client.put_container(self.url, self.token, container,"},{"line_number":164,"context_line":"                                 headers\u003d{\u0027X-Storage-Policy\u0027: policy.name})"}],"source_content_type":"text/x-python","patch_set":5,"id":"9abb7d3a_d956fe04","line":161,"in_reply_to":"9abb7d3a_a2dddae1","updated":"2016-06-01 13:14:50.000000000","message":"Done","commit_id":"fc3514174e0de527d12a46ea6eda0873b30a4e9c"},{"author":{"_account_id":4608,"name":"Kota Tsuyuzaki","email":"bloodeagle40234@gmail.com","username":"tsuyuzaki-kota"},"change_message_id":"828ede2e8d11118c9a33441a0d91546ce67cbade","unresolved":false,"context_lines":[{"line_number":189,"context_line":"                            \u0027Config for account-reaper was not found\u0027)"},{"line_number":190,"context_line":""},{"line_number":191,"context_line":"        # reap after 4 seconds, and make sure that nothing is reaped"},{"line_number":192,"context_line":"        sleep(4)"},{"line_number":193,"context_line":"        for account_reaper in account_reapers:"},{"line_number":194,"context_line":"            account_reaper.run_once()"},{"line_number":195,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"9abb7d3a_36b92b7a","line":192,"updated":"2016-06-01 06:54:32.000000000","message":"This works but I think 4 sec sleep is too close to the delay time, I hope all account_reaper.run_once() will finish in a sec but if it doesn\u0027t, following assertions will fail.\n\nI tried to calculate the running time. The time my virtual machine spent for L193-L194 is:\n\n reaping time: 0.0197548866272 (sec)\n\nHmm...that looks not so matter?\n\nIMHO, it seems better i we can run account_reaper immediately here, and then asserting nothing to reap. After that, sleep after the delayed time....\n\nDoes it fit your thought?","commit_id":"fc3514174e0de527d12a46ea6eda0873b30a4e9c"},{"author":{"_account_id":8330,"name":"Doron Chen","email":"cdoron@il.ibm.com","username":"cdoron"},"change_message_id":"8887c2f466101953c1c04605cce726c9ab629564","unresolved":false,"context_lines":[{"line_number":189,"context_line":"                            \u0027Config for account-reaper was not found\u0027)"},{"line_number":190,"context_line":""},{"line_number":191,"context_line":"        # reap after 4 seconds, and make sure that nothing is reaped"},{"line_number":192,"context_line":"        sleep(4)"},{"line_number":193,"context_line":"        for account_reaper in account_reapers:"},{"line_number":194,"context_line":"            account_reaper.run_once()"},{"line_number":195,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"9abb7d3a_0af826c2","line":192,"in_reply_to":"9abb7d3a_36b92b7a","updated":"2016-06-01 13:14:50.000000000","message":"I changed the test so that the delay is 3 seconds. I run the reaper straight away, confirm that nothing is reaped, and then tries again 3 seconds later.","commit_id":"fc3514174e0de527d12a46ea6eda0873b30a4e9c"},{"author":{"_account_id":4608,"name":"Kota Tsuyuzaki","email":"bloodeagle40234@gmail.com","username":"tsuyuzaki-kota"},"change_message_id":"828ede2e8d11118c9a33441a0d91546ce67cbade","unresolved":false,"context_lines":[{"line_number":203,"context_line":"                except ClientException as err:"},{"line_number":204,"context_line":"                    self.fail(\"Nothing should reaped. Object should exist\")"},{"line_number":205,"context_line":""},{"line_number":206,"context_line":"            object_ring \u003d POLICIES.get_object_ring(policy.idx, \u0027/etc/swift/\u0027)"},{"line_number":207,"context_line":"            part, nodes \u003d object_ring.get_nodes(self.account, container, obj)"},{"line_number":208,"context_line":"            headers \u003d {\u0027X-Backend-Storage-Policy-Index\u0027: int(policy)}"},{"line_number":209,"context_line":"            for node in nodes:"}],"source_content_type":"text/x-python","patch_set":5,"id":"9abb7d3a_164ce79c","line":206,"updated":"2016-06-01 06:54:32.000000000","message":"nits: policy.idx -\u003e int(policy) to be same as 2 lines later if we keep POLICIES.get_object_ring.","commit_id":"fc3514174e0de527d12a46ea6eda0873b30a4e9c"},{"author":{"_account_id":8330,"name":"Doron Chen","email":"cdoron@il.ibm.com","username":"cdoron"},"change_message_id":"8887c2f466101953c1c04605cce726c9ab629564","unresolved":false,"context_lines":[{"line_number":203,"context_line":"                except ClientException as err:"},{"line_number":204,"context_line":"                    self.fail(\"Nothing should reaped. Object should exist\")"},{"line_number":205,"context_line":""},{"line_number":206,"context_line":"            object_ring \u003d POLICIES.get_object_ring(policy.idx, \u0027/etc/swift/\u0027)"},{"line_number":207,"context_line":"            part, nodes \u003d object_ring.get_nodes(self.account, container, obj)"},{"line_number":208,"context_line":"            headers \u003d {\u0027X-Backend-Storage-Policy-Index\u0027: int(policy)}"},{"line_number":209,"context_line":"            for node in nodes:"}],"source_content_type":"text/x-python","patch_set":5,"id":"9abb7d3a_c52291a2","line":206,"in_reply_to":"9abb7d3a_164ce79c","updated":"2016-06-01 13:14:50.000000000","message":"Following the changes you proposed, this line (and similar lines later) no longer exist.","commit_id":"fc3514174e0de527d12a46ea6eda0873b30a4e9c"},{"author":{"_account_id":4608,"name":"Kota Tsuyuzaki","email":"bloodeagle40234@gmail.com","username":"tsuyuzaki-kota"},"change_message_id":"828ede2e8d11118c9a33441a0d91546ce67cbade","unresolved":false,"context_lines":[{"line_number":234,"context_line":"                try:"},{"line_number":235,"context_line":"                    direct_get_object(node, part, self.account,"},{"line_number":236,"context_line":"                                      container, obj, headers\u003dheaders)"},{"line_number":237,"context_line":"                except ClientException as err:"},{"line_number":238,"context_line":"                    self.fail(\"Nothing should reaped. Object should exist\")"},{"line_number":239,"context_line":""},{"line_number":240,"context_line":"        # wait another 2 seconds (about 6 seconds after reaper defined),"}],"source_content_type":"text/x-python","patch_set":5,"id":"9abb7d3a_f9531415","line":237,"updated":"2016-06-01 06:54:32.000000000","message":"Ah, why do we need to check the existence twice?\nI think the reason why test_sync (another test above) did is for the sanity \"replicator/updator doesn\u0027t restore the reaped objects\" so that IMHO we need the check twice only after account_reaper deletes everything. Is it right?\n\n\nAnd I tried to check the running time for this twice check as well as reaping time above.\n\n do twice time: 18.0420560837\n\nOops, probably we don\u0027t have to sleep 2 sec at L242 so something like\n\n while time.time() \u003c account_delete_time + 5:\n     sleep(0.1)\n\nis enough to save much time?","commit_id":"fc3514174e0de527d12a46ea6eda0873b30a4e9c"},{"author":{"_account_id":8330,"name":"Doron Chen","email":"cdoron@il.ibm.com","username":"cdoron"},"change_message_id":"8887c2f466101953c1c04605cce726c9ab629564","unresolved":false,"context_lines":[{"line_number":234,"context_line":"                try:"},{"line_number":235,"context_line":"                    direct_get_object(node, part, self.account,"},{"line_number":236,"context_line":"                                      container, obj, headers\u003dheaders)"},{"line_number":237,"context_line":"                except ClientException as err:"},{"line_number":238,"context_line":"                    self.fail(\"Nothing should reaped. Object should exist\")"},{"line_number":239,"context_line":""},{"line_number":240,"context_line":"        # wait another 2 seconds (about 6 seconds after reaper defined),"}],"source_content_type":"text/x-python","patch_set":5,"id":"9abb7d3a_850b69d5","line":237,"in_reply_to":"9abb7d3a_f9531415","updated":"2016-06-01 13:14:50.000000000","message":"As you suggested, I no longer check twice that no reaping occurred. I do check twice after the reaping.\n\nI did not add the while loop. Currently there is only one sleep, and it is for 3 seconds. Hopefully, this is not too painful.","commit_id":"fc3514174e0de527d12a46ea6eda0873b30a4e9c"},{"author":{"_account_id":4608,"name":"Kota Tsuyuzaki","email":"bloodeagle40234@gmail.com","username":"tsuyuzaki-kota"},"change_message_id":"828ede2e8d11118c9a33441a0d91546ce67cbade","unresolved":false,"context_lines":[{"line_number":261,"context_line":"                    direct_get_object(node, part, self.account,"},{"line_number":262,"context_line":"                                      container, obj, headers\u003dheaders)"},{"line_number":263,"context_line":"                except ClientException as err:"},{"line_number":264,"context_line":"                    self.assertEqual(err.http_status, 404)"},{"line_number":265,"context_line":"                else:"},{"line_number":266,"context_line":"                    self.fail(\u0027Found un-reaped /%s/%s/%s on %r in %s!\u0027 %"},{"line_number":267,"context_line":"                              (self.account, container, obj, node, policy))"}],"source_content_type":"text/x-python","patch_set":5,"id":"9abb7d3a_8cdf2868","line":264,"updated":"2016-06-01 06:54:32.000000000","message":"Could you please add delete timestamp check as well as another reapling test[1]? (X-Backend-DELETE-Timestamp for containers, X-Backend-Timestamp for objects)\n\n1: https://github.com/openstack/swift/blob/master/test/probe/test_account_reaper.py#L138-L141","commit_id":"fc3514174e0de527d12a46ea6eda0873b30a4e9c"},{"author":{"_account_id":8330,"name":"Doron Chen","email":"cdoron@il.ibm.com","username":"cdoron"},"change_message_id":"8887c2f466101953c1c04605cce726c9ab629564","unresolved":false,"context_lines":[{"line_number":261,"context_line":"                    direct_get_object(node, part, self.account,"},{"line_number":262,"context_line":"                                      container, obj, headers\u003dheaders)"},{"line_number":263,"context_line":"                except ClientException as err:"},{"line_number":264,"context_line":"                    self.assertEqual(err.http_status, 404)"},{"line_number":265,"context_line":"                else:"},{"line_number":266,"context_line":"                    self.fail(\u0027Found un-reaped /%s/%s/%s on %r in %s!\u0027 %"},{"line_number":267,"context_line":"                              (self.account, container, obj, node, policy))"}],"source_content_type":"text/x-python","patch_set":5,"id":"9abb7d3a_a5bdcdd9","line":264,"in_reply_to":"9abb7d3a_8cdf2868","updated":"2016-06-01 13:14:50.000000000","message":"I added the timestamp checks.\nWhat do you mean by another reaping test? There are already two reaping tests.","commit_id":"fc3514174e0de527d12a46ea6eda0873b30a4e9c"},{"author":{"_account_id":4608,"name":"Kota Tsuyuzaki","email":"bloodeagle40234@gmail.com","username":"tsuyuzaki-kota"},"change_message_id":"7ee4545f9b3c7815848286aec5211a3984f75fb2","unresolved":false,"context_lines":[{"line_number":261,"context_line":"                    direct_get_object(node, part, self.account,"},{"line_number":262,"context_line":"                                      container, obj, headers\u003dheaders)"},{"line_number":263,"context_line":"                except ClientException as err:"},{"line_number":264,"context_line":"                    self.assertEqual(err.http_status, 404)"},{"line_number":265,"context_line":"                else:"},{"line_number":266,"context_line":"                    self.fail(\u0027Found un-reaped /%s/%s/%s on %r in %s!\u0027 %"},{"line_number":267,"context_line":"                              (self.account, container, obj, node, policy))"}],"source_content_type":"text/x-python","patch_set":5,"id":"9abb7d3a_bad5bf43","line":264,"in_reply_to":"9abb7d3a_a5bdcdd9","updated":"2016-06-02 05:19:38.000000000","message":"Ah, I meant \"please add those timestamp check as same as test_sync\" so your new patch addressed my comment completely. Thanks.","commit_id":"fc3514174e0de527d12a46ea6eda0873b30a4e9c"},{"author":{"_account_id":4608,"name":"Kota Tsuyuzaki","email":"bloodeagle40234@gmail.com","username":"tsuyuzaki-kota"},"change_message_id":"734691a515e51883d8e720ca53c85d88f2b9d55e","unresolved":false,"context_lines":[{"line_number":126,"context_line":"                else:"},{"line_number":127,"context_line":"                    self.fail(\u0027Found un-reaped /%s/%s on %r\u0027 %"},{"line_number":128,"context_line":"                              (self.account, container, cnode))"},{"line_number":129,"context_line":"            self.assertEqual(1, len(delete_times))"},{"line_number":130,"context_line":""},{"line_number":131,"context_line":"            # sanity check that object state is still consistent..."},{"line_number":132,"context_line":"            object_ring \u003d POLICIES.get_object_ring(policy.idx, \u0027/etc/swift/\u0027)"}],"source_content_type":"text/x-python","patch_set":6,"id":"9abb7d3a_9ffb8d46","line":129,"updated":"2016-06-02 05:22:55.000000000","message":"Nice!","commit_id":"4af96cdda4029cbc74891cb7b093bdf92599c5c6"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"54e788df9e35d1e358f4e852a60cefda6d27b0b2","unresolved":false,"context_lines":[{"line_number":126,"context_line":"                else:"},{"line_number":127,"context_line":"                    self.fail(\u0027Found un-reaped /%s/%s on %r\u0027 %"},{"line_number":128,"context_line":"                              (self.account, container, cnode))"},{"line_number":129,"context_line":"            self.assertEqual(1, len(delete_times))"},{"line_number":130,"context_line":""},{"line_number":131,"context_line":"            # sanity check that object state is still consistent..."},{"line_number":132,"context_line":"            object_ring \u003d POLICIES.get_object_ring(policy.idx, \u0027/etc/swift/\u0027)"}],"source_content_type":"text/x-python","patch_set":6,"id":"9ad45d7e_9b6d4435","line":129,"in_reply_to":"9abb7d3a_9ffb8d46","updated":"2016-08-08 17:12:22.000000000","message":"+1 good catch","commit_id":"4af96cdda4029cbc74891cb7b093bdf92599c5c6"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"54e788df9e35d1e358f4e852a60cefda6d27b0b2","unresolved":false,"context_lines":[{"line_number":149,"context_line":"            self.assertEqual(1, len(delete_times))"},{"line_number":150,"context_line":""},{"line_number":151,"context_line":"    def test_delayed_reap(self):"},{"line_number":152,"context_line":"        def get_account_reapers(delay):"},{"line_number":153,"context_line":"            reapers \u003d []"},{"line_number":154,"context_line":"            for conf_file in self.configs[\u0027account-server\u0027].values():"},{"line_number":155,"context_line":"                conf \u003d utils.readconf(conf_file, \u0027account-reaper\u0027)"}],"source_content_type":"text/x-python","patch_set":6,"id":"9ad45d7e_7bcb3073","line":152,"updated":"2016-08-08 17:12:22.000000000","message":"I\u0027m not convinced this code needs to be in a function","commit_id":"4af96cdda4029cbc74891cb7b093bdf92599c5c6"},{"author":{"_account_id":8330,"name":"Doron Chen","email":"cdoron@il.ibm.com","username":"cdoron"},"change_message_id":"4657fc7aebfbd14d3f28c8816b898c6ed73a7a04","unresolved":false,"context_lines":[{"line_number":149,"context_line":"            self.assertEqual(1, len(delete_times))"},{"line_number":150,"context_line":""},{"line_number":151,"context_line":"    def test_delayed_reap(self):"},{"line_number":152,"context_line":"        def get_account_reapers(delay):"},{"line_number":153,"context_line":"            reapers \u003d []"},{"line_number":154,"context_line":"            for conf_file in self.configs[\u0027account-server\u0027].values():"},{"line_number":155,"context_line":"                conf \u003d utils.readconf(conf_file, \u0027account-reaper\u0027)"}],"source_content_type":"text/x-python","patch_set":6,"id":"9ad45d7e_dc7d96b2","line":152,"in_reply_to":"9ad45d7e_7bcb3073","updated":"2016-08-10 08:18:04.000000000","message":"I changed it. This is no longer in a function.","commit_id":"4af96cdda4029cbc74891cb7b093bdf92599c5c6"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"54e788df9e35d1e358f4e852a60cefda6d27b0b2","unresolved":false,"context_lines":[{"line_number":164,"context_line":"            client.put_container(self.url, self.token, container,"},{"line_number":165,"context_line":"                                 headers\u003d{\u0027X-Storage-Policy\u0027: policy.name})"},{"line_number":166,"context_line":"            obj \u003d \u0027object-%s\u0027 % uuid.uuid4()"},{"line_number":167,"context_line":"            body \u003d \u0027test-body\u0027"},{"line_number":168,"context_line":"            client.put_object(self.url, self.token, container, obj, body)"},{"line_number":169,"context_line":"            all_objects.append((policy, container, obj))"},{"line_number":170,"context_line":"            policy.load_ring(\u0027/etc/swift\u0027)"}],"source_content_type":"text/x-python","patch_set":6,"id":"9ad45d7e_22a191aa","line":167,"updated":"2016-08-08 17:12:22.000000000","message":"nit: body could be assigned outside of the loop, which avoids a \"may not be assigned\" warning at line 181","commit_id":"4af96cdda4029cbc74891cb7b093bdf92599c5c6"},{"author":{"_account_id":8330,"name":"Doron Chen","email":"cdoron@il.ibm.com","username":"cdoron"},"change_message_id":"4657fc7aebfbd14d3f28c8816b898c6ed73a7a04","unresolved":false,"context_lines":[{"line_number":164,"context_line":"            client.put_container(self.url, self.token, container,"},{"line_number":165,"context_line":"                                 headers\u003d{\u0027X-Storage-Policy\u0027: policy.name})"},{"line_number":166,"context_line":"            obj \u003d \u0027object-%s\u0027 % uuid.uuid4()"},{"line_number":167,"context_line":"            body \u003d \u0027test-body\u0027"},{"line_number":168,"context_line":"            client.put_object(self.url, self.token, container, obj, body)"},{"line_number":169,"context_line":"            all_objects.append((policy, container, obj))"},{"line_number":170,"context_line":"            policy.load_ring(\u0027/etc/swift\u0027)"}],"source_content_type":"text/x-python","patch_set":6,"id":"9ad45d7e_3c4b1289","line":167,"in_reply_to":"9ad45d7e_22a191aa","updated":"2016-08-10 08:18:04.000000000","message":"Done","commit_id":"4af96cdda4029cbc74891cb7b093bdf92599c5c6"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"54e788df9e35d1e358f4e852a60cefda6d27b0b2","unresolved":false,"context_lines":[{"line_number":188,"context_line":"        # define reapers which are supposed to operate 3 seconds later"},{"line_number":189,"context_line":"        account_reapers \u003d get_account_reapers(\u00273\u0027)"},{"line_number":190,"context_line":"        self.assertNotEqual(0, len(account_reapers),"},{"line_number":191,"context_line":"                            \u0027Config for account-reaper was not found\u0027)"},{"line_number":192,"context_line":""},{"line_number":193,"context_line":"        # run reaper, and make sure that nothing is reaped"},{"line_number":194,"context_line":"        for account_reaper in account_reapers:"}],"source_content_type":"text/x-python","patch_set":6,"id":"9ad45d7e_a2a3c19d","line":191,"updated":"2016-08-08 17:12:22.000000000","message":"nit: or\n\n  self.assertTrue(account_reapers)","commit_id":"4af96cdda4029cbc74891cb7b093bdf92599c5c6"},{"author":{"_account_id":8330,"name":"Doron Chen","email":"cdoron@il.ibm.com","username":"cdoron"},"change_message_id":"4657fc7aebfbd14d3f28c8816b898c6ed73a7a04","unresolved":false,"context_lines":[{"line_number":188,"context_line":"        # define reapers which are supposed to operate 3 seconds later"},{"line_number":189,"context_line":"        account_reapers \u003d get_account_reapers(\u00273\u0027)"},{"line_number":190,"context_line":"        self.assertNotEqual(0, len(account_reapers),"},{"line_number":191,"context_line":"                            \u0027Config for account-reaper was not found\u0027)"},{"line_number":192,"context_line":""},{"line_number":193,"context_line":"        # run reaper, and make sure that nothing is reaped"},{"line_number":194,"context_line":"        for account_reaper in account_reapers:"}],"source_content_type":"text/x-python","patch_set":6,"id":"9ad45d7e_7c458a6e","line":191,"in_reply_to":"9ad45d7e_a2a3c19d","updated":"2016-08-10 08:18:04.000000000","message":"Done","commit_id":"4af96cdda4029cbc74891cb7b093bdf92599c5c6"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"54e788df9e35d1e358f4e852a60cefda6d27b0b2","unresolved":false,"context_lines":[{"line_number":192,"context_line":""},{"line_number":193,"context_line":"        # run reaper, and make sure that nothing is reaped"},{"line_number":194,"context_line":"        for account_reaper in account_reapers:"},{"line_number":195,"context_line":"            account_reaper.run_once()"},{"line_number":196,"context_line":""},{"line_number":197,"context_line":"        for policy, container, obj in all_objects:"},{"line_number":198,"context_line":"            cpart, cnodes \u003d self.container_ring.get_nodes("}],"source_content_type":"text/x-python","patch_set":6,"id":"9ad45d7e_7b233006","line":195,"updated":"2016-08-08 17:12:22.000000000","message":"note the reapers will run sequentially vs other test in which they are spawned in parallel.","commit_id":"4af96cdda4029cbc74891cb7b093bdf92599c5c6"},{"author":{"_account_id":8330,"name":"Doron Chen","email":"cdoron@il.ibm.com","username":"cdoron"},"change_message_id":"4657fc7aebfbd14d3f28c8816b898c6ed73a7a04","unresolved":false,"context_lines":[{"line_number":192,"context_line":""},{"line_number":193,"context_line":"        # run reaper, and make sure that nothing is reaped"},{"line_number":194,"context_line":"        for account_reaper in account_reapers:"},{"line_number":195,"context_line":"            account_reaper.run_once()"},{"line_number":196,"context_line":""},{"line_number":197,"context_line":"        for policy, container, obj in all_objects:"},{"line_number":198,"context_line":"            cpart, cnodes \u003d self.container_ring.get_nodes("}],"source_content_type":"text/x-python","patch_set":6,"id":"9ad45d7e_dc2bd692","line":195,"in_reply_to":"9ad45d7e_7b233006","updated":"2016-08-10 08:18:04.000000000","message":"Right. The code is simpler this way. I hope that\u0027s okay.","commit_id":"4af96cdda4029cbc74891cb7b093bdf92599c5c6"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"54e788df9e35d1e358f4e852a60cefda6d27b0b2","unresolved":false,"context_lines":[{"line_number":201,"context_line":"                try:"},{"line_number":202,"context_line":"                    direct_head_container(cnode, cpart, self.account,"},{"line_number":203,"context_line":"                                          container)"},{"line_number":204,"context_line":"                except ClientException as err:"},{"line_number":205,"context_line":"                    self.fail(\"Nothing should reaped. Object should exist\")"},{"line_number":206,"context_line":""},{"line_number":207,"context_line":"            part, nodes \u003d policy.object_ring.get_nodes(self.account,"}],"source_content_type":"text/x-python","patch_set":6,"id":"9ad45d7e_5609e32b","line":204,"updated":"2016-08-08 17:12:22.000000000","message":"\u0027err\u0027 is unused, not sure why pep8 did not catch that","commit_id":"4af96cdda4029cbc74891cb7b093bdf92599c5c6"},{"author":{"_account_id":8330,"name":"Doron Chen","email":"cdoron@il.ibm.com","username":"cdoron"},"change_message_id":"4657fc7aebfbd14d3f28c8816b898c6ed73a7a04","unresolved":false,"context_lines":[{"line_number":201,"context_line":"                try:"},{"line_number":202,"context_line":"                    direct_head_container(cnode, cpart, self.account,"},{"line_number":203,"context_line":"                                          container)"},{"line_number":204,"context_line":"                except ClientException as err:"},{"line_number":205,"context_line":"                    self.fail(\"Nothing should reaped. Object should exist\")"},{"line_number":206,"context_line":""},{"line_number":207,"context_line":"            part, nodes \u003d policy.object_ring.get_nodes(self.account,"}],"source_content_type":"text/x-python","patch_set":6,"id":"9ad45d7e_3c195289","line":204,"in_reply_to":"9ad45d7e_5609e32b","updated":"2016-08-10 08:18:04.000000000","message":"Done","commit_id":"4af96cdda4029cbc74891cb7b093bdf92599c5c6"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"54e788df9e35d1e358f4e852a60cefda6d27b0b2","unresolved":false,"context_lines":[{"line_number":211,"context_line":"                try:"},{"line_number":212,"context_line":"                    direct_get_object(node, part, self.account,"},{"line_number":213,"context_line":"                                      container, obj, headers\u003dheaders)"},{"line_number":214,"context_line":"                except ClientException as err:"},{"line_number":215,"context_line":"                    self.fail(\"Nothing should reaped. Object should exist\")"},{"line_number":216,"context_line":""},{"line_number":217,"context_line":"        # wait 3 seconds, run reaper, and make sure that all is reaped"}],"source_content_type":"text/x-python","patch_set":6,"id":"9ad45d7e_bb03e80e","line":214,"updated":"2016-08-08 17:12:22.000000000","message":"\u0027err\u0027 is unused, not sure why pep8 did not catch that","commit_id":"4af96cdda4029cbc74891cb7b093bdf92599c5c6"},{"author":{"_account_id":8330,"name":"Doron Chen","email":"cdoron@il.ibm.com","username":"cdoron"},"change_message_id":"4657fc7aebfbd14d3f28c8816b898c6ed73a7a04","unresolved":false,"context_lines":[{"line_number":211,"context_line":"                try:"},{"line_number":212,"context_line":"                    direct_get_object(node, part, self.account,"},{"line_number":213,"context_line":"                                      container, obj, headers\u003dheaders)"},{"line_number":214,"context_line":"                except ClientException as err:"},{"line_number":215,"context_line":"                    self.fail(\"Nothing should reaped. Object should exist\")"},{"line_number":216,"context_line":""},{"line_number":217,"context_line":"        # wait 3 seconds, run reaper, and make sure that all is reaped"}],"source_content_type":"text/x-python","patch_set":6,"id":"9ad45d7e_5c16c655","line":214,"in_reply_to":"9ad45d7e_bb03e80e","updated":"2016-08-10 08:18:04.000000000","message":"Done","commit_id":"4af96cdda4029cbc74891cb7b093bdf92599c5c6"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"54e788df9e35d1e358f4e852a60cefda6d27b0b2","unresolved":false,"context_lines":[{"line_number":215,"context_line":"                    self.fail(\"Nothing should reaped. Object should exist\")"},{"line_number":216,"context_line":""},{"line_number":217,"context_line":"        # wait 3 seconds, run reaper, and make sure that all is reaped"},{"line_number":218,"context_line":"        sleep(3)"},{"line_number":219,"context_line":"        for account_reaper in account_reapers:"},{"line_number":220,"context_line":"            account_reaper.run_once()"},{"line_number":221,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"9ad45d7e_9b3f0425","line":218,"updated":"2016-08-08 17:12:22.000000000","message":"nit: the sleep only needs to until time.time() \u003e 3 + \u003ctime at which accounts were deleted\u003e ; some time will have already elapsed while the reapers ran.","commit_id":"4af96cdda4029cbc74891cb7b093bdf92599c5c6"},{"author":{"_account_id":8330,"name":"Doron Chen","email":"cdoron@il.ibm.com","username":"cdoron"},"change_message_id":"4657fc7aebfbd14d3f28c8816b898c6ed73a7a04","unresolved":false,"context_lines":[{"line_number":215,"context_line":"                    self.fail(\"Nothing should reaped. Object should exist\")"},{"line_number":216,"context_line":""},{"line_number":217,"context_line":"        # wait 3 seconds, run reaper, and make sure that all is reaped"},{"line_number":218,"context_line":"        sleep(3)"},{"line_number":219,"context_line":"        for account_reaper in account_reapers:"},{"line_number":220,"context_line":"            account_reaper.run_once()"},{"line_number":221,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"9ad45d7e_fc07ba19","line":218,"in_reply_to":"9ad45d7e_9b3f0425","updated":"2016-08-10 08:18:04.000000000","message":"The code is simpler this way. I hope that\u0027s okay.","commit_id":"4af96cdda4029cbc74891cb7b093bdf92599c5c6"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"54e788df9e35d1e358f4e852a60cefda6d27b0b2","unresolved":false,"context_lines":[{"line_number":243,"context_line":"            self.assertEqual(1, len(delete_times), delete_times)"},{"line_number":244,"context_line":""},{"line_number":245,"context_line":"            part, nodes \u003d policy.object_ring.get_nodes(self.account,"},{"line_number":246,"context_line":"                                                       container, obj)"},{"line_number":247,"context_line":"            headers \u003d {\u0027X-Backend-Storage-Policy-Index\u0027: int(policy)}"},{"line_number":248,"context_line":"            delete_times \u003d set()"},{"line_number":249,"context_line":"            for node in nodes:"}],"source_content_type":"text/x-python","patch_set":6,"id":"9ad45d7e_5858f2fa","line":246,"updated":"2016-08-08 17:12:22.000000000","message":"nice improvement vs line 88","commit_id":"4af96cdda4029cbc74891cb7b093bdf92599c5c6"},{"author":{"_account_id":8330,"name":"Doron Chen","email":"cdoron@il.ibm.com","username":"cdoron"},"change_message_id":"4657fc7aebfbd14d3f28c8816b898c6ed73a7a04","unresolved":false,"context_lines":[{"line_number":243,"context_line":"            self.assertEqual(1, len(delete_times), delete_times)"},{"line_number":244,"context_line":""},{"line_number":245,"context_line":"            part, nodes \u003d policy.object_ring.get_nodes(self.account,"},{"line_number":246,"context_line":"                                                       container, obj)"},{"line_number":247,"context_line":"            headers \u003d {\u0027X-Backend-Storage-Policy-Index\u0027: int(policy)}"},{"line_number":248,"context_line":"            delete_times \u003d set()"},{"line_number":249,"context_line":"            for node in nodes:"}],"source_content_type":"text/x-python","patch_set":6,"id":"9ad45d7e_bf141444","line":246,"in_reply_to":"9ad45d7e_5858f2fa","updated":"2016-08-10 08:18:04.000000000","message":"Credit goes to Kota.","commit_id":"4af96cdda4029cbc74891cb7b093bdf92599c5c6"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"54e788df9e35d1e358f4e852a60cefda6d27b0b2","unresolved":false,"context_lines":[{"line_number":287,"context_line":""},{"line_number":288,"context_line":"            # sanity check that object state is still consistent..."},{"line_number":289,"context_line":"            object_ring \u003d POLICIES.get_object_ring(policy.idx, \u0027/etc/swift/\u0027)"},{"line_number":290,"context_line":"            part, nodes \u003d object_ring.get_nodes(self.account, container, obj)"},{"line_number":291,"context_line":"            headers \u003d {\u0027X-Backend-Storage-Policy-Index\u0027: int(policy)}"},{"line_number":292,"context_line":"            delete_times \u003d set()"},{"line_number":293,"context_line":"            for node in nodes:"}],"source_content_type":"text/x-python","patch_set":6,"id":"9ad45d7e_d86ce29e","line":290,"updated":"2016-08-08 17:12:22.000000000","message":"could be improved same as at line 246","commit_id":"4af96cdda4029cbc74891cb7b093bdf92599c5c6"},{"author":{"_account_id":8330,"name":"Doron Chen","email":"cdoron@il.ibm.com","username":"cdoron"},"change_message_id":"4657fc7aebfbd14d3f28c8816b898c6ed73a7a04","unresolved":false,"context_lines":[{"line_number":287,"context_line":""},{"line_number":288,"context_line":"            # sanity check that object state is still consistent..."},{"line_number":289,"context_line":"            object_ring \u003d POLICIES.get_object_ring(policy.idx, \u0027/etc/swift/\u0027)"},{"line_number":290,"context_line":"            part, nodes \u003d object_ring.get_nodes(self.account, container, obj)"},{"line_number":291,"context_line":"            headers \u003d {\u0027X-Backend-Storage-Policy-Index\u0027: int(policy)}"},{"line_number":292,"context_line":"            delete_times \u003d set()"},{"line_number":293,"context_line":"            for node in nodes:"}],"source_content_type":"text/x-python","patch_set":6,"id":"9ad45d7e_9f0f902d","line":290,"in_reply_to":"9ad45d7e_d86ce29e","updated":"2016-08-10 08:18:04.000000000","message":"Done","commit_id":"4af96cdda4029cbc74891cb7b093bdf92599c5c6"},{"author":{"_account_id":4608,"name":"Kota Tsuyuzaki","email":"bloodeagle40234@gmail.com","username":"tsuyuzaki-kota"},"change_message_id":"c3381a5665536b08bdeb38d91fe1017637737ca0","unresolved":false,"context_lines":[{"line_number":28,"context_line":""},{"line_number":29,"context_line":"class TestAccountReaper(ReplProbeTest):"},{"line_number":30,"context_line":"    def setUp(self):"},{"line_number":31,"context_line":"        super(TestAccountReaper, self).setUp()"},{"line_number":32,"context_line":"        self.all_objects \u003d []"},{"line_number":33,"context_line":"        # upload some containers"},{"line_number":34,"context_line":"        body \u003d \u0027test-body\u0027"}],"source_content_type":"text/x-python","patch_set":7,"id":"3ac371cc_d91cf579","line":31,"updated":"2016-08-15 06:20:50.000000000","message":"I got a problem here when running both tests in this class. That is caused since TestAccountReaper is using the same account (i.e. AUTH_test) for testing.\n\nIn the Swift behavior, a DELETE account request will issue the delete flag to the account db, and account-reaper find the flag and reap all containers/objects in the account.\n\nAfter that, account-replicator will reclaim the db (i.e. delete the db file from file system). While existing the db, Swift doesn\u0027t allow to make the same name account because it may enable to show the existing containers/objects in the old account.\n\nWhen running this test as is, the first test will run successfully but the other one will fail because the AUTH_test was deleted but not yet reclaimed (i.e. we will get 410 Gone due to the reclaim_age which is a week in default).[1]\n\nI think, we could resolve the issue with [2], to run account-replicator with reclaim_age\u003d0 for cleaning up the dir.\n\n\n1: https://gist.github.com/bloodeagle40234/34f063239136114d313e48c14dfd7fba\n2: https://review.openstack.org/355308","commit_id":"44ba3c310a90f6db49417220ca979fd945ca1799"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"5cf604ba1167f9724b8bac8e5c7032a1a70b6dbe","unresolved":false,"context_lines":[{"line_number":28,"context_line":""},{"line_number":29,"context_line":"class TestAccountReaper(ReplProbeTest):"},{"line_number":30,"context_line":"    def setUp(self):"},{"line_number":31,"context_line":"        super(TestAccountReaper, self).setUp()"},{"line_number":32,"context_line":"        self.all_objects \u003d []"},{"line_number":33,"context_line":"        # upload some containers"},{"line_number":34,"context_line":"        body \u003d \u0027test-body\u0027"}],"source_content_type":"text/x-python","patch_set":7,"id":"3ac371cc_fd64364a","line":31,"in_reply_to":"3ac371cc_d91cf579","updated":"2016-08-15 09:03:46.000000000","message":"@Kota hmmm, I do not see that problem, and the first thing that setup() does (before every test method) is to call resetswift() [1], which erases all state from Swift, so the tests should be independent. I wonder what is causing you to see the 410?\n\nIf you run with \n\n  nosetests ./test/probe/test_account_reaper.py -s\n\nyou\u0027ll see all the output from resetswift between tests\n e.g. [2]\n\n[1] https://github.com/openstack/swift/blob/6b0e9a3e2464406743e01a3dd789d30c2bf81a2a/test/probe/common.py#L322-L322\n\n[2] http://paste.openstack.org/show/557474/","commit_id":"44ba3c310a90f6db49417220ca979fd945ca1799"},{"author":{"_account_id":4608,"name":"Kota Tsuyuzaki","email":"bloodeagle40234@gmail.com","username":"tsuyuzaki-kota"},"change_message_id":"c3381a5665536b08bdeb38d91fe1017637737ca0","unresolved":false,"context_lines":[{"line_number":57,"context_line":"        for node in nodes:"},{"line_number":58,"context_line":"            direct_delete_account(node, part, self.account)"},{"line_number":59,"context_line":""},{"line_number":60,"context_line":"    def test_sync(self):"},{"line_number":61,"context_line":"        # run the reaper"},{"line_number":62,"context_line":"        Manager([\u0027account-reaper\u0027]).once()"},{"line_number":63,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"3ac371cc_19732db3","line":60,"updated":"2016-08-15 06:20:50.000000000","message":"nits) this looks like not a \u0027test_sync\u0027 but a \u0027test_reap\u0027, anymore?\n\nand I prefer to move this one to under the _verify_account_reaped because we could find the bunch of actual tests easily if they are placed close places.","commit_id":"44ba3c310a90f6db49417220ca979fd945ca1799"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"5cf604ba1167f9724b8bac8e5c7032a1a70b6dbe","unresolved":false,"context_lines":[{"line_number":57,"context_line":"        for node in nodes:"},{"line_number":58,"context_line":"            direct_delete_account(node, part, self.account)"},{"line_number":59,"context_line":""},{"line_number":60,"context_line":"    def test_sync(self):"},{"line_number":61,"context_line":"        # run the reaper"},{"line_number":62,"context_line":"        Manager([\u0027account-reaper\u0027]).once()"},{"line_number":63,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"3ac371cc_7dacc6ed","line":60,"in_reply_to":"3ac371cc_19732db3","updated":"2016-08-15 09:03:46.000000000","message":"I agree and would be happy for this to move below _verify_account_reaped. I suggested leaving it in the current oder in file because I was concerned it would confuse other reviewers to move the code around, but if Kota is happy for it to move then let\u0027s do it, the end result will be better :)","commit_id":"44ba3c310a90f6db49417220ca979fd945ca1799"},{"author":{"_account_id":4608,"name":"Kota Tsuyuzaki","email":"bloodeagle40234@gmail.com","username":"tsuyuzaki-kota"},"change_message_id":"e1d577f9dcaba1f2e8085aa0b6565211a68dcde3","unresolved":false,"context_lines":[{"line_number":57,"context_line":"        for node in nodes:"},{"line_number":58,"context_line":"            direct_delete_account(node, part, self.account)"},{"line_number":59,"context_line":""},{"line_number":60,"context_line":"    def test_sync(self):"},{"line_number":61,"context_line":"        # run the reaper"},{"line_number":62,"context_line":"        Manager([\u0027account-reaper\u0027]).once()"},{"line_number":63,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"3ac371cc_20131a0f","line":60,"in_reply_to":"3ac371cc_7dacc6ed","updated":"2016-08-16 01:38:21.000000000","message":"Ok, we can do it in follow up","commit_id":"44ba3c310a90f6db49417220ca979fd945ca1799"},{"author":{"_account_id":4608,"name":"Kota Tsuyuzaki","email":"bloodeagle40234@gmail.com","username":"tsuyuzaki-kota"},"change_message_id":"c3381a5665536b08bdeb38d91fe1017637737ca0","unresolved":false,"context_lines":[{"line_number":174,"context_line":"                    direct_head_container(cnode, cpart, self.account,"},{"line_number":175,"context_line":"                                          container)"},{"line_number":176,"context_line":"                except ClientException:"},{"line_number":177,"context_line":"                    self.fail(\"Nothing should be reaped. Object should exist\")"},{"line_number":178,"context_line":""},{"line_number":179,"context_line":"            part, nodes \u003d policy.object_ring.get_nodes(self.account,"},{"line_number":180,"context_line":"                                                       container, obj)"}],"source_content_type":"text/x-python","patch_set":7,"id":"3ac371cc_fce8bf18","line":177,"range":{"start_line":177,"start_character":57,"end_line":177,"end_character":63},"updated":"2016-08-15 06:20:50.000000000","message":"Container?","commit_id":"44ba3c310a90f6db49417220ca979fd945ca1799"}]}
