test.regrtest: flush stdout when display progress (GH-7105)

runtest_mp.py: call print() with flush=True.
(cherry picked from commit 4f0bc7f7ab)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
This commit is contained in:
Miss Islington (bot) 2018-05-25 10:08:23 -07:00 committed by GitHub
parent 20b797dafa
commit ecd0bb2693
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -187,7 +187,7 @@ def get_running(workers):
except queue.Empty:
running = get_running(workers)
if running and not regrtest.ns.pgo:
print('running: %s' % ', '.join(running))
print('running: %s' % ', '.join(running), flush=True)
continue
test, stdout, stderr, result = item
@ -239,6 +239,6 @@ def get_running(workers):
line = "Waiting for %s (%s tests)" % (', '.join(running), len(running))
if dt >= WAIT_PROGRESS:
line = "%s since %.0f sec" % (line, dt)
print(line)
print(line, flush=True)
for worker in workers:
worker.join(WAIT_PROGRESS)