Skip to content

Commit 058b99f

Browse files
authored
Report running tests in update-to-meta script (#440)
It turned out that a test script blocked in the update-to-aas-core-meta development script, but the current version of the script only listed the number of running scripts, and not which script was blocking. In this patch, we explicitly lists which tests are still running after the initial expected runtime, so that the developer can take action if needed.
1 parent ac58f10 commit 058b99f

File tree

1 file changed

+32
-5
lines changed

1 file changed

+32
-5
lines changed

dev_scripts/update_to_aas_core_meta.py

+32-5
Original file line numberDiff line numberDiff line change
@@ -128,14 +128,37 @@ def _rerecord_everything(repo_dir: pathlib.Path) -> Optional[int]:
128128

129129
procs.append(proc)
130130

131+
assert len(starting_points) == len(procs)
132+
131133
failure = False
132-
remaining_procs = sum(1 for proc in procs if proc.returncode is None)
134+
remaining_procs_starting_points = [
135+
(starting_point, proc)
136+
for starting_point, proc in zip(starting_points, procs)
137+
if proc.returncode is None
138+
]
139+
140+
loop_start = time.time()
133141

134142
next_print = time.time() + 5
135-
while remaining_procs > 0:
143+
while len(remaining_procs_starting_points) > 0:
136144
if time.time() > next_print:
137-
print(f"There are {remaining_procs} remaining test(s) running.")
138-
next_print = time.time() + 5
145+
if time.time() - loop_start < 60:
146+
print(
147+
f"There are {len(remaining_procs_starting_points)} "
148+
f"remaining test(s) running."
149+
)
150+
next_print = time.time() + 5
151+
else:
152+
message_lines = [
153+
f"There are {len(remaining_procs_starting_points)} tests running:"
154+
]
155+
for starting_point, proc in remaining_procs_starting_points:
156+
message_lines.append(
157+
f" {starting_point} (return code: {proc.returncode})"
158+
)
159+
160+
print("\n".join(message_lines))
161+
next_print = time.time() + 20
139162

140163
time.sleep(1)
141164

@@ -160,7 +183,11 @@ def _rerecord_everything(repo_dir: pathlib.Path) -> Optional[int]:
160183
for proc in procs:
161184
proc.poll()
162185

163-
remaining_procs = sum(1 for proc in procs if proc.returncode is None)
186+
remaining_procs_starting_points = [
187+
(starting_point, proc)
188+
for starting_point, proc in zip(starting_points, procs)
189+
if proc.returncode is None
190+
]
164191

165192
duration = time.perf_counter() - start
166193
print(f"Re-recording took: {duration:.2f} seconds.")

0 commit comments

Comments
 (0)