test: parallelize test/run via xargs -P; 180s per-tool timeout
test/run fans test/wcc/*.c across $(nproc) workers via xargs -0 -n2 -P $JOBS; each worker writes <prefix>.status and an optional <prefix>.fail sentinel into a mktemp results dir. The driver collects in glob order so output stays deterministic across runs. Wraps every ww/w6c/w6a/w6l/wwdump invocation in 990-995 with `timeout 180`, bounding orphan compilers under 8-way contention. The direct runwait(exe) calls for fresh-built test binaries get the same treatment via a "timeout 180 %s" snprintf hop. Motivation: pid 2101 was a w6c_ww that ran 42h on /tmp/wcas_asm_1326_15.ww until we killed it during this session; timeout makes that impossible. 993's /tmp/ww_d_hello.ww is now pid-keyed (snprintf %d getpid); without it concurrent runs (or future shards of 993 itself) would race on the staging file. Wall: 9m59s → 4m31s on 8 cores. Same 132/132 status.
This commit is contained in:
@@ -66,14 +66,14 @@ diff_one(const char *bin, const char *label, const char *src)
|
||||
snprintf(ws, sizeof ws, "/tmp/wwc6_%d_w.s", getpid());
|
||||
snprintf(cs, sizeof cs, "/tmp/wwc6_%d_c.s", getpid());
|
||||
|
||||
snprintf(cmd, sizeof cmd, "%s/wwdump_ww -c %s > %s 2>/dev/null",
|
||||
snprintf(cmd, sizeof cmd, "timeout 180 %s/wwdump_ww -c %s > %s 2>/dev/null",
|
||||
bin, src, ws);
|
||||
if (runwait(cmd) != 0) {
|
||||
fprintf(stderr, "w6c_ww FAIL: wwdump_ww -c errored on %s\n", label);
|
||||
unlink(ws);
|
||||
return -1;
|
||||
}
|
||||
snprintf(cmd, sizeof cmd, "%s/w6c_ww -o %s %s 2>/dev/null", bin, cs, src);
|
||||
snprintf(cmd, sizeof cmd, "timeout 180 %s/w6c_ww -o %s %s 2>/dev/null", bin, cs, src);
|
||||
if (runwait(cmd) != 0) {
|
||||
fprintf(stderr, "w6c_ww FAIL: w6c_ww errored on %s\n", label);
|
||||
unlink(ws); unlink(cs);
|
||||
@@ -268,9 +268,9 @@ main(void)
|
||||
snprintf(s, sizeof s, "/tmp/wwc6_bad_%d_%d.s", getpid(), i);
|
||||
if (write_file(src, bad[i].src) != 0) { fail++; n++; continue; }
|
||||
snprintf(wcmd, sizeof wcmd,
|
||||
"%s/w6c_ww -o %s %s >/dev/null 2>&1", bin, s, src);
|
||||
"timeout 180 %s/w6c_ww -o %s %s >/dev/null 2>&1", bin, s, src);
|
||||
snprintf(dcmd, sizeof dcmd,
|
||||
"%s/wwdump_ww -c %s >%s 2>/dev/null", bin, src, s);
|
||||
"timeout 180 %s/wwdump_ww -c %s >%s 2>/dev/null", bin, src, s);
|
||||
if (runwait(wcmd) == 0) {
|
||||
fprintf(stderr,
|
||||
"w6c_ww FAIL: %s slipped past check (silent miscompile)\n",
|
||||
|
||||
Reference in New Issue
Block a user