Skip to content

Commit 6b06b59

Browse files
authored
Flush stdout/stderr between wasm-opt tests (#8680)
Without this the github CI often shows the errors in confusing locations interspersed with the test names. I confirmed in #8679 that this addresses the issue. Maybe there is a better place to do this but this is good improvement for now.
1 parent 9851810 commit 6b06b59

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

scripts/test/wasm_opt.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
import os
1616
import shutil
1717
import subprocess
18+
import sys
1819

1920
from . import shared, support
2021

@@ -60,6 +61,12 @@ def test_wasm_opt():
6061
opts = [('--' + p if not p.startswith('O') and p != 'g' else '-' + p) for p in passes]
6162
actual = ''
6263
for module, asserts in support.split_wast(t):
64+
# Flush stdout/stderr between each test. This prevent confusing
65+
# interleaving in output of github CI
66+
# TODO: Find a better, more systematic way to achieve this that
67+
# works for all test suites.
68+
sys.stdout.flush()
69+
sys.stderr.flush()
6370
assert len(asserts) == 0
6471
support.write_wast('split.wast', module)
6572
cmd = shared.WASM_OPT + opts + ['split.wast', '-q']

0 commit comments

Comments
 (0)