Skip to content

Commit

Permalink
Create an empty test bep file before starting bazelci-agent. (#2001)
Browse files Browse the repository at this point in the history
  • Loading branch information
coeuvre authored Jul 11, 2024
1 parent cb00eea commit aa52cef
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion buildkite/bazelci.py
Original file line number Diff line number Diff line change
Expand Up @@ -1447,6 +1447,9 @@ def PrepareRepoInCwd(print_cmd_groups, initial_setup=False):
eprint(ex)

test_bep_file = os.path.join(tmpdir, _TEST_BEP_FILE)
# Create an empty test_bep_file so that the bazelci-agent can start to follow the file right away. Otherwise,
# there is a race between when bazelci-agent starts to read the file and when Bazel creates the file.
open(test_bep_file, 'w').close()
with concurrent.futures.ThreadPoolExecutor() as executor:
future = executor.submit(
upload_test_logs_from_bep, test_bep_file, tmpdir, monitor_flaky_tests
Expand Down Expand Up @@ -2701,7 +2704,6 @@ def upload_test_logs_from_bep(bep_file, tmpdir, monitor_flaky_tests):
"artifact",
"upload",
"--debug", # Force BEP upload for non-flaky failures
"--delay=5",
"--mode=buildkite",
"--build_event_json_file={}".format(bep_file),
]
Expand Down

0 comments on commit aa52cef

Please sign in to comment.