)]}'
{"os_testr/ostestr.py":[{"author":{"_account_id":5196,"name":"Matthew Treinish","email":"mtreinish@kortar.org","username":"treinish"},"change_message_id":"8fee963b39a1f92d8717e40458f4c9ca2cbd4648","unresolved":false,"context_lines":[{"line_number":174,"context_line":""},{"line_number":175,"context_line":"def call_subunit_run(test_id, pretty, subunit):"},{"line_number":176,"context_line":"    env \u003d copy.deepcopy(os.environ)"},{"line_number":177,"context_line":"    cmd_save_results \u003d [\u0027testr\u0027, \u0027load\u0027, \u0027--subunit\u0027]"},{"line_number":178,"context_line":""},{"line_number":179,"context_line":"    if pretty:"},{"line_number":180,"context_line":"        subprocess.call([\u0027testr\u0027, \u0027init\u0027], env\u003denv)"}],"source_content_type":"text/x-python","patch_set":1,"id":"7f515b1d_84597736","line":177,"updated":"2017-10-05 16:28:13.000000000","message":"So the real bug here is this, we\u0027re not using testr anymore and it\u0027s not being installed by ostestr. This should be removed. and L185 and L198 should be replaced with calls commands.load()","commit_id":"3204786b2c47f1dcf705397ec71d13fb1a1facdf"},{"author":{"_account_id":5196,"name":"Matthew Treinish","email":"mtreinish@kortar.org","username":"treinish"},"change_message_id":"261cc0818acbabf286cd19f55875991b3ceb811d","unresolved":false,"context_lines":[{"line_number":186,"context_line":"    else:"},{"line_number":187,"context_line":"        sstdout \u003d io.BytesIO()"},{"line_number":188,"context_line":"        subunit_run.main([sys.argv[0], test_id], sstdout)"},{"line_number":189,"context_line":"        sstdout.seek(0)"},{"line_number":190,"context_line":"        commands.load_command(subunit_out\u003dTrue,"},{"line_number":191,"context_line":"                              pretty_out\u003dbool(pretty or not subunit),"},{"line_number":192,"context_line":"                              in_streams\u003d[(\u0027subunit\u0027, sstdout)])"}],"source_content_type":"text/x-python","patch_set":4,"id":"5f4e5783_fc25110a","line":189,"updated":"2017-10-15 19:16:37.000000000","message":"So while I get this is what I recommended before, and is similar to how load() was being called before, this has the negative side effect of breaking real time output. We have to run all the tests once then seek back to the beginning and then print the output.\n\nIt makes me wonder if we want to use a pipe and a thread here to get the output in real time. So basically replace this block with something like::\n\n  sstdout_r, sstdout_w \u003d os.pipe()\n  \n  def run_subunit_thread():\n      subunit_run.main([sys.argv[0], test_id], sstdout_w)\n      sstdout_w.close()\n\n  run_thread \u003d threading.Thread(target\u003drun_subunit_thread)\n  run_thread.start()\n  commands.load_command(subunit_out\u003dsubunit,\n                        pretty_out\u003dpretty,\n                        in_streams[(\u0027subunit\u0027, sstdout_r)])","commit_id":"faf5d27cc4740e115dcafa1934afedff61e433af"},{"author":{"_account_id":5196,"name":"Matthew Treinish","email":"mtreinish@kortar.org","username":"treinish"},"change_message_id":"bedfa5c98d4836fe7e5bc764d06ff007ad0e6053","unresolved":false,"context_lines":[{"line_number":186,"context_line":"    else:"},{"line_number":187,"context_line":"        sstdout \u003d io.BytesIO()"},{"line_number":188,"context_line":"        subunit_run.main([sys.argv[0], test_id], sstdout)"},{"line_number":189,"context_line":"        sstdout.seek(0)"},{"line_number":190,"context_line":"        commands.load_command(subunit_out\u003dTrue,"},{"line_number":191,"context_line":"                              pretty_out\u003dbool(pretty or not subunit),"},{"line_number":192,"context_line":"                              in_streams\u003d[(\u0027subunit\u0027, sstdout)])"}],"source_content_type":"text/x-python","patch_set":4,"id":"3f4b6375_5d2ed143","line":189,"in_reply_to":"3f4b6375_07e158ff","updated":"2017-10-19 15:59:38.000000000","message":"Well it\u0027s actually more about timing on the output filter. The problem is how subunit trace does it\u0027s timing generation. It does a time delta between the start and end of test run outside of subunit. (literally calling datetime.utcnow() before and after we process the stream) So if we do the seek(0) you\u0027ll see subunit-trace say the test ran in like 1 sec (or however long it takes to parse the stream). Depending on what you pass to run this can differ significantly from reality. This is a bug I\u0027ve been meaning to fix in stestr load but haven\u0027t gotten around to.","commit_id":"faf5d27cc4740e115dcafa1934afedff61e433af"},{"author":{"_account_id":9542,"name":"Pavlo Shchelokovskyy","email":"pshchelokovskyy@mirantis.com","username":"pshchelo"},"change_message_id":"5e1c1906d0c693c7c8ef68d4085add53441748eb","unresolved":false,"context_lines":[{"line_number":186,"context_line":"    else:"},{"line_number":187,"context_line":"        sstdout \u003d io.BytesIO()"},{"line_number":188,"context_line":"        subunit_run.main([sys.argv[0], test_id], sstdout)"},{"line_number":189,"context_line":"        sstdout.seek(0)"},{"line_number":190,"context_line":"        commands.load_command(subunit_out\u003dTrue,"},{"line_number":191,"context_line":"                              pretty_out\u003dbool(pretty or not subunit),"},{"line_number":192,"context_line":"                              in_streams\u003d[(\u0027subunit\u0027, sstdout)])"}],"source_content_type":"text/x-python","patch_set":4,"id":"df7087c5_9fae72e5","line":189,"in_reply_to":"3f4b6375_5d2ed143","updated":"2018-03-21 18:48:02.000000000","message":"done, but a some quirks still there, see a comment","commit_id":"faf5d27cc4740e115dcafa1934afedff61e433af"},{"author":{"_account_id":9542,"name":"Pavlo Shchelokovskyy","email":"pshchelokovskyy@mirantis.com","username":"pshchelo"},"change_message_id":"85a56a083bd47cb581955deb0d546fd243010630","unresolved":false,"context_lines":[{"line_number":186,"context_line":"    else:"},{"line_number":187,"context_line":"        sstdout \u003d io.BytesIO()"},{"line_number":188,"context_line":"        subunit_run.main([sys.argv[0], test_id], sstdout)"},{"line_number":189,"context_line":"        sstdout.seek(0)"},{"line_number":190,"context_line":"        commands.load_command(subunit_out\u003dTrue,"},{"line_number":191,"context_line":"                              pretty_out\u003dbool(pretty or not subunit),"},{"line_number":192,"context_line":"                              in_streams\u003d[(\u0027subunit\u0027, sstdout)])"}],"source_content_type":"text/x-python","patch_set":4,"id":"3f4b6375_07e158ff","line":189,"in_reply_to":"5f4e5783_fc25110a","updated":"2017-10-18 06:11:00.000000000","message":"I don\u0027t actually think this should be a big concern - this method is generally invoked on a subset of tests only, most probably a single one, so real time output is not that important.\n\nBut I\u0027ll see what I could do.","commit_id":"faf5d27cc4740e115dcafa1934afedff61e433af"}]}
