)]}'
{"oslo_policy/tests/test_cache_handler.py":[{"author":{"_account_id":6928,"name":"Ben Nemec","email":"openstack@nemebean.com","username":"bnemec"},"change_message_id":"41be048d7c51d66250705a67d823fd527f0511ec","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# Copyright (c) 2012 OpenStack Foundation."},{"line_number":2,"context_line":"# All Rights Reserved."},{"line_number":3,"context_line":""},{"line_number":4,"context_line":"#    Licensed under the Apache License, Version 2.0 (the \"License\"); you may"}],"source_content_type":"text/x-python","patch_set":2,"id":"3fa7e38b_70e0a727","line":1,"updated":"2019-12-02 15:33:22.000000000","message":"This is highly unlikely, unless these tests were written in 2012. This line should probably be:\n\nCopyright 2019 Red Hat Inc.","commit_id":"ef8973de80e9750a1d8a3953187a8e092b5b5377"},{"author":{"_account_id":6928,"name":"Ben Nemec","email":"openstack@nemebean.com","username":"bnemec"},"change_message_id":"41be048d7c51d66250705a67d823fd527f0511ec","unresolved":false,"context_lines":[{"line_number":30,"context_line":""},{"line_number":31,"context_line":"    def test_read_cached_file(self):"},{"line_number":32,"context_line":"        file_cache \u003d {}"},{"line_number":33,"context_line":"        tmpdir \u003d os.path.join(tempfile.gettempdir(), str(uuid.uuid4()))"},{"line_number":34,"context_line":"        os.mkdir(tmpdir)"},{"line_number":35,"context_line":"        myfile \u003d \"{tmpdir}/tmpfile\".format(tmpdir\u003dtmpdir)"},{"line_number":36,"context_line":"        with open(myfile, \"w+\") as fp:"}],"source_content_type":"text/x-python","patch_set":2,"id":"3fa7e38b_691e7a60","line":33,"range":{"start_line":33,"start_character":53,"end_line":33,"end_character":70},"updated":"2019-12-02 15:33:22.000000000","message":"Is there any reason we need to do this? gettempdir already returns a randomized name, doesn\u0027t it?","commit_id":"ef8973de80e9750a1d8a3953187a8e092b5b5377"},{"author":{"_account_id":6928,"name":"Ben Nemec","email":"openstack@nemebean.com","username":"bnemec"},"change_message_id":"41be048d7c51d66250705a67d823fd527f0511ec","unresolved":false,"context_lines":[{"line_number":45,"context_line":"                                              force_reload\u003dTrue)"},{"line_number":46,"context_line":"        self.assertEqual(data, \"test\")"},{"line_number":47,"context_line":"        self.assertTrue(reloaded)"},{"line_number":48,"context_line":"        time.sleep(2)"},{"line_number":49,"context_line":"        os.remove(myfile)"},{"line_number":50,"context_line":"        with open(myfile, \"w+\") as fp:"},{"line_number":51,"context_line":"            fp.write(\"foo\")"}],"source_content_type":"text/x-python","patch_set":2,"id":"3fa7e38b_092d868e","line":48,"updated":"2019-12-02 15:33:22.000000000","message":"Why?","commit_id":"ef8973de80e9750a1d8a3953187a8e092b5b5377"},{"author":{"_account_id":6928,"name":"Ben Nemec","email":"openstack@nemebean.com","username":"bnemec"},"change_message_id":"41be048d7c51d66250705a67d823fd527f0511ec","unresolved":false,"context_lines":[{"line_number":52,"context_line":"        reloaded, data \u003d _ch.read_cached_file(file_cache, myfile)"},{"line_number":53,"context_line":"        self.assertEqual(data, \"foo\")"},{"line_number":54,"context_line":"        self.assertTrue(reloaded)"},{"line_number":55,"context_line":"        shutil.rmtree(tmpdir)"}],"source_content_type":"text/x-python","patch_set":2,"id":"3fa7e38b_a997929c","line":55,"updated":"2019-12-02 15:33:22.000000000","message":"You shouldn\u0027t need to do this. oslotest\u0027s base class sets up the nested tempfile fixture that automatically cleans up any temporary directories you create during a test.\n\nAlso worth noting that this wouldn\u0027t clean things up if the test failed. It would need to be in a try...finally.","commit_id":"ef8973de80e9750a1d8a3953187a8e092b5b5377"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"d0ff23ae695b15ccb18c255634c229f127447a85","unresolved":false,"context_lines":[{"line_number":51,"context_line":"            fp.write(\"test\")"},{"line_number":52,"context_line":"        reloaded, data \u003d _ch.read_cached_file(file_cache, myfile)"},{"line_number":53,"context_line":"        os.remove(myfile)"},{"line_number":54,"context_line":"        # Sometime removing a file take longer to execute than expected"},{"line_number":55,"context_line":"        # and so our test fail."},{"line_number":56,"context_line":"        # To avoid this situation so we need to make a tiny pause to avoid"},{"line_number":57,"context_line":"        # this issue and also to be sure that our test will works as expected."},{"line_number":58,"context_line":"        # Note that often this test works without this pause, but sometime"}],"source_content_type":"text/x-python","patch_set":4,"id":"9f560f44_ef209cb4","line":55,"range":{"start_line":54,"start_character":0,"end_line":55,"end_character":31},"updated":"2020-09-14 16:08:37.000000000","message":"You mean the call to \u0027os.remove\u0027? Hardly. That\u0027s a synchronous action.","commit_id":"22c4c4c6e7f99cd1c7a0c274ec4a4306f50c3c73"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"81fb0ad7096cfd4828757b296835985672fedced","unresolved":false,"context_lines":[{"line_number":51,"context_line":"            fp.write(\"test\")"},{"line_number":52,"context_line":"        reloaded, data \u003d _ch.read_cached_file(file_cache, myfile)"},{"line_number":53,"context_line":"        os.remove(myfile)"},{"line_number":54,"context_line":"        # Sometime removing a file take longer to execute than expected"},{"line_number":55,"context_line":"        # and so our test fail."},{"line_number":56,"context_line":"        # To avoid this situation so we need to make a tiny pause to avoid"},{"line_number":57,"context_line":"        # this issue and also to be sure that our test will works as expected."},{"line_number":58,"context_line":"        # Note that often this test works without this pause, but sometime"}],"source_content_type":"text/x-python","patch_set":4,"id":"2098c528_2dcf4596","line":55,"range":{"start_line":54,"start_character":0,"end_line":55,"end_character":31},"in_reply_to":"9f560f44_ef209cb4","updated":"2021-02-09 14:32:35.000000000","message":"Yes, this isn\u0027t failing because os.remove is slow. It\u0027s failing because it\u0027s fast, and the check for modified time is returning the same result across the two files.","commit_id":"22c4c4c6e7f99cd1c7a0c274ec4a4306f50c3c73"}]}
