Skip to content

Commit b30fea3

Browse files
committed
fix test timeout
1 parent 6d830f3 commit b30fea3

File tree

1 file changed

+12
-24
lines changed

1 file changed

+12
-24
lines changed

toolchain/mfc/test/test.py

Lines changed: 12 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -327,19 +327,10 @@ def _handle_case(case: TestCase, devices: typing.Set[int]):
327327
return
328328

329329
try:
330-
# Decide which targets to run in a single pipeline.
331-
# - Default: PRE_PROCESS + SIMULATION (used for golden comparison)
332-
# - With --test-all (-a): also include POST_PROCESS so that the configuration
333-
# used by simulation and post_process is consistent (e.g. parallel_io,
334-
# file_per_process, *_wrt flags). This ensures simulation writes the
335-
# Lustre-style restart/grid files (e.g. restart_data/lustre_x_cb.dat)
336-
# that post_process expects.
337-
targets = [PRE_PROCESS, SIMULATION, POST_PROCESS] if ARG("test_all") else [PRE_PROCESS, SIMULATION]
338-
339330
# Check timeout before starting
340331
if timeout_flag.is_set():
341332
raise TestTimeoutError("Test case exceeded 1 hour timeout")
342-
cmd = case.run(targets, gpus=devices)
333+
cmd = case.run([PRE_PROCESS, SIMULATION], gpus=devices)
343334

344335
# Check timeout after simulation
345336
if timeout_flag.is_set():
@@ -351,9 +342,6 @@ def _handle_case(case: TestCase, devices: typing.Set[int]):
351342

352343
if cmd.returncode != 0:
353344
cons.print(cmd.stdout)
354-
# If test_all is enabled and the pipeline failed, provide extra debug info
355-
if ARG("test_all") and getattr(case, "ppn", 1) >= 2:
356-
_print_multirank_debug_info(case)
357345
raise MFCException(f"Test {case}: Failed to execute MFC.")
358346

359347
pack, err = packer.pack(case.get_dirpath())
@@ -389,18 +377,18 @@ def _handle_case(case: TestCase, devices: typing.Set[int]):
389377
raise MFCException(f"Test {case}: {msg}")
390378

391379
if ARG("test_all"):
392-
# We already ran PRE_PROCESS, SIMULATION, and POST_PROCESS together
393-
# in the single pipeline above. At this point:
394-
# - If cmd.returncode != 0, post_process (or an earlier stage)
395-
# failed and we want to surface that with verbose diagnostics.
396-
# - If cmd.returncode == 0, post_process completed and should
397-
# have written its outputs (e.g., silo_hdf5) based on a
398-
# configuration that had "post_process" in ARGS["mfc"]["targets"],
399-
# so parallel_io and restart_data layout are consistent.
400-
380+
# Clean up output from golden comparison run
381+
case.delete_output()
382+
383+
# Check timeout before full pipeline
384+
if timeout_flag.is_set():
385+
raise TestTimeoutError("Test case exceeded 1 hour timeout")
386+
387+
# Run full pipeline: this ensures simulation and post_process use
388+
# consistent configuration (parallel_io, file_per_process, etc.)
389+
cmd = case.run([PRE_PROCESS, SIMULATION, POST_PROCESS], gpus=devices)
390+
401391
out_post_filepath = os.path.join(case.get_dirpath(), "out_post.txt")
402-
# Write the full pipeline output to an explicit post-process log too,
403-
# even though it includes pre/sim messages. This is helpful for CI.
404392
common.file_write(out_post_filepath, cmd.stdout)
405393

406394
if cmd.returncode != 0:

0 commit comments

Comments
 (0)