Skip to content

Commit e589317

Browse files
committed
[run_cperf] Minimize race condition between workspace setups.
1 parent 532fa82 commit e589317

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

run_cperf

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,13 +90,21 @@ def main():
9090
with open(ws_comment, 'w') as f:
9191
f.write("Compilation-performance test failed")
9292

93+
# First _get_ all the sources (with as little a gap between
94+
# fetches as possible to minimize race possibility)
9395
for instance in instances:
9496
workspace = get_workspace_for_instance(instance, args)
9597

9698
if args.setup_workspaces_for_pr:
9799
setup_workspace(instance, workspace, args)
98100
validate_workspace(instance, workspace, args)
99101

102+
# Then _build and test_ both workspaces, which can take
103+
# longer since we're not concerned about racing on github
104+
# anymore.
105+
for instance in instances:
106+
workspace = get_workspace_for_instance(instance, args)
107+
100108
if not args.skip_build:
101109
build_swift_toolchain(workspace, args)
102110

0 commit comments

Comments
 (0)