)]}'
{"nova/tests/fixtures.py":[{"author":{"_account_id":8864,"name":"Artom Lifshitz","email":"notartom@gmail.com","username":"artom"},"change_message_id":"8a1dce29086c6df867dc4028dbe985fd310289c4","unresolved":false,"context_lines":[{"line_number":2232,"context_line":"                # TODO(efried): Figure out how to mock the sleep in"},{"line_number":2233,"context_line":"                # oslo_messaging._drivers.impl_fake.FakeListener.poll"},{"line_number":2234,"context_line":"                if \u0027oslo_messaging/_drivers/impl_fake.py\u0027 not in tb:"},{"line_number":2235,"context_line":"                    raise ValueError(tb + \u0027\\nMock sleep in this test!\u0027)"},{"line_number":2236,"context_line":"            return self.real_sleep(seconds)"},{"line_number":2237,"context_line":"        self.useFixture(fixtures.MockPatch(\u0027time.sleep\u0027, side_effect\u003d_sleep))"}],"source_content_type":"text/x-python","patch_set":4,"id":"5fc1f717_81baeabd","line":2235,"range":{"start_line":2235,"start_character":45,"end_line":2235,"end_character":68},"updated":"2019-03-29 15:24:37.000000000","message":"This is going to really confuse anyone who hits this for the first time without being aware of this new fixture. We need to be more explicit, something like:\n\n\"Your test is calling time.sleep(). In order to save gate time, the SleepPoisinFixture prevents time.sleep() from being called directly. If you really need to sleep, please call self.real_sleep(). Otherwise, please mock out time.sleep()\"","commit_id":"954e1f38af5e20baacab255a5f9726a42c99863c"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"5b61c73c14d5f8caf19c5c335f91e39a5acd7eb7","unresolved":false,"context_lines":[{"line_number":2232,"context_line":"                # TODO(efried): Figure out how to mock the sleep in"},{"line_number":2233,"context_line":"                # oslo_messaging._drivers.impl_fake.FakeListener.poll"},{"line_number":2234,"context_line":"                if \u0027oslo_messaging/_drivers/impl_fake.py\u0027 not in tb:"},{"line_number":2235,"context_line":"                    raise ValueError(tb + \u0027\\nMock sleep in this test!\u0027)"},{"line_number":2236,"context_line":"            return self.real_sleep(seconds)"},{"line_number":2237,"context_line":"        self.useFixture(fixtures.MockPatch(\u0027time.sleep\u0027, side_effect\u003d_sleep))"}],"source_content_type":"text/x-python","patch_set":4,"id":"5fc1f717_1c0bc17d","line":2235,"range":{"start_line":2235,"start_character":45,"end_line":2235,"end_character":68},"in_reply_to":"5fc1f717_81baeabd","updated":"2019-03-29 16:19:51.000000000","message":"Ack, good suggestion.","commit_id":"954e1f38af5e20baacab255a5f9726a42c99863c"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"4991c86551fe24993e816d0e5f4fa1f04d608916","unresolved":false,"context_lines":[{"line_number":2231,"context_line":"                tb \u003d \u0027\u0027.join(traceback.format_stack())"},{"line_number":2232,"context_line":"                # TODO(efried): Figure out how to mock the sleep in"},{"line_number":2233,"context_line":"                # oslo_messaging._drivers.impl_fake.FakeListener.poll"},{"line_number":2234,"context_line":"                if \u0027oslo_messaging/_drivers/impl_fake.py\u0027 not in tb:"},{"line_number":2235,"context_line":"                    msg \u003d ("},{"line_number":2236,"context_line":"                        \"Your test, or code it invokes, is calling \""},{"line_number":2237,"context_line":"                        \"time.sleep(). In order to reduce test time, the \""}],"source_content_type":"text/x-python","patch_set":6,"id":"5fc1f717_a76a967e","line":2234,"updated":"2019-03-29 16:53:56.000000000","message":"I don\u0027t really think we should merge anything like this. Any difference in how these files get laid out on disk could cause this to fail to detect properly. In a frozen environment (not sure if the win32 people run like that or not) then this is also likely to be different.\n\nHowever, the fact that we need to do this is part of why I\u0027m highly concerned with just doing this globally -- it\u0027s a pretty core piece of functionality that everything we import into our process will choke on. Maybe in obvious ways like this, but maybe not. What if I have a polling loop in some library that wraps a sleep and a poll and catches ValueError for the poll? That library will behave very strangely and non-obviously, only in these tests and for a very obscure reason.","commit_id":"2a8d417913fe32777393e796684d4712e827e2ac"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"4991c86551fe24993e816d0e5f4fa1f04d608916","unresolved":false,"context_lines":[{"line_number":2239,"context_line":"                        \"called directly. If you really need to sleep, please \""},{"line_number":2240,"context_line":"                        \"call self.real_sleep(). Otherwise, please mock out \""},{"line_number":2241,"context_line":"                        \"time.sleep() in this test case.\")"},{"line_number":2242,"context_line":"                    raise ValueError(\u0027\\n\u0027.join((tb, msg)))"},{"line_number":2243,"context_line":"            return self.real_sleep(seconds)"},{"line_number":2244,"context_line":"        self.useFixture(fixtures.MockPatch(\u0027time.sleep\u0027, side_effect\u003d_sleep))"}],"source_content_type":"text/x-python","patch_set":6,"id":"5fc1f717_e7473e1e","line":2242,"updated":"2019-03-29 16:53:56.000000000","message":"This is really invasive, IMHO. Aside from making people mock out sleep any time they tickle code that runs through a sleep (which I know is the point), it also has the potential to cause us some strange behaviors for code that depends on the sleep yielding to another greenthread.\n\nIf we\u0027re going to do this globally, what if we replace this with a warning, and an implementation that always really calls sleep()? Maybe call sleep(0) the first time and sleep(0.1) every time after that. We get the same yield behavior, but massively reduce the amount of time we actually sleep for.","commit_id":"2a8d417913fe32777393e796684d4712e827e2ac"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"cf31d10d1860cbf364d871cf63f8d834a48a4bfc","unresolved":false,"context_lines":[{"line_number":2239,"context_line":"                        \"called directly. If you really need to sleep, please \""},{"line_number":2240,"context_line":"                        \"call self.real_sleep(). Otherwise, please mock out \""},{"line_number":2241,"context_line":"                        \"time.sleep() in this test case.\")"},{"line_number":2242,"context_line":"                    raise ValueError(\u0027\\n\u0027.join((tb, msg)))"},{"line_number":2243,"context_line":"            return self.real_sleep(seconds)"},{"line_number":2244,"context_line":"        self.useFixture(fixtures.MockPatch(\u0027time.sleep\u0027, side_effect\u003d_sleep))"}],"source_content_type":"text/x-python","patch_set":6,"id":"5fc1f717_36b5797f","line":2242,"in_reply_to":"5fc1f717_e7473e1e","updated":"2019-03-29 19:34:25.000000000","message":"\u003e If we\u0027re going to do this globally, what if we replace this with a\n \u003e warning,\n\nThe warning doesn\u0027t show up unless the test fails, though, right?\n\n \u003e Maybe call sleep(0) the first time and sleep(0.1) every time after\n \u003e that. We get the same yield behavior, but massively reduce the\n \u003e amount of time we actually sleep for.\n\nI actually tried something like that and the oslo_service thing is still a problem (it actually hung my computer).","commit_id":"2a8d417913fe32777393e796684d4712e827e2ac"}],"nova/tests/functional/api_sample_tests/test_servers.py":[{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"4991c86551fe24993e816d0e5f4fa1f04d608916","unresolved":false,"context_lines":[{"line_number":628,"context_line":"                              return_json_body\u003dTrue)[\u0027server\u0027]"},{"line_number":629,"context_line":"        count \u003d 0"},{"line_number":630,"context_line":"        while server[\u0027status\u0027] !\u003d \u0027ACTIVE\u0027 and count \u003c 10:"},{"line_number":631,"context_line":"            self.real_sleep(1)"},{"line_number":632,"context_line":"            server \u003d self._do_get(\u0027servers/%s\u0027 % uuid,"},{"line_number":633,"context_line":"                                  return_json_body\u003dTrue)[\u0027server\u0027]"},{"line_number":634,"context_line":"            count +\u003d 1"}],"source_content_type":"text/x-python","patch_set":6,"id":"5fc1f717_675d8eeb","line":631,"updated":"2019-03-29 16:53:56.000000000","message":"I really hate this. I understand what you\u0027re trying to do (force people to have to think about it) but it seems like a really impactful new requirement for what is really a pretty small gain.","commit_id":"2a8d417913fe32777393e796684d4712e827e2ac"}]}
