Skip to content

Commit 37480a6

Browse files
authored
Merge pull request #1376 from ahoppen/flush-stdout-before-serial-test-run
Flush stdout after issuing message that we re-run tests in serial
2 parents 899d857 + e2f6f5d commit 37480a6

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

Utilities/build-script-helper.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -206,8 +206,8 @@ def run_tests(swift_exec: str, args: argparse.Namespace) -> None:
206206
"""
207207
swiftpm_args = get_swiftpm_options(swift_exec, args, suppress_verbose=True)
208208
additional_env = get_swiftpm_environment_variables(swift_exec, args)
209-
# 'swift test' doesn't print os_log output to the command line. Use the
210-
# `NonDarwinLogger` that prints to stderr so we can view the log output in CI test
209+
# 'swift test' doesn't print os_log output to the command line. Use the
210+
# `NonDarwinLogger` that prints to stderr so we can view the log output in CI test
211211
# runs.
212212
additional_env['SOURCEKITLSP_FORCE_NON_DARWIN_LOGGER'] = '1'
213213

@@ -233,6 +233,7 @@ def run_tests(swift_exec: str, args: argparse.Namespace) -> None:
233233
check_call(cmd + ['--parallel'], additional_env=additional_env, verbose=args.verbose)
234234
except:
235235
print('--- Running tests in parallel failed. Re-running tests serially to capture more actionable output.')
236+
sys.stdout.flush()
236237
check_call(cmd, additional_env=additional_env, verbose=args.verbose)
237238
# Return with non-zero exit code even if serial test execution succeeds.
238239
raise SystemExit(1)
@@ -249,7 +250,7 @@ def install(swift_exec: str, args: argparse.Namespace) -> None:
249250
swiftpm_args = get_swiftpm_options(swift_exec, args)
250251
additional_env = get_swiftpm_environment_variables(swift_exec, args)
251252
bin_path = swiftpm_bin_path(swift_exec, swiftpm_args=swiftpm_args, additional_env=additional_env)
252-
253+
253254
for prefix in args.install_prefixes:
254255
install_binary('sourcekit-lsp', bin_path, os.path.join(prefix, 'bin'), verbose=args.verbose)
255256

0 commit comments

Comments
 (0)