Skip to content

Commit 7be1bd5

Browse files
committed
fix(e2e): 231's no-op check must mark time after the first build, not before it
1 parent 8546610 commit 7be1bd5

1 file changed

Lines changed: 9 additions & 4 deletions

File tree

tests/e2e/231_jobs_option.sh

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,10 +111,15 @@ grep -q 'schedule=detach-codegen\|schedule=two-phase\|schedule=none' "$ninja_fil
111111
# that a second build is a no-op. A schedule whose depfile target is wrong looks
112112
# exactly like success while recompiling everything — the symptom that cost the
113113
# most to find — and a no-op is what exposes it.
114-
before=$(find target -name '*.o' -newer "$TMP/sched.txt" | wc -l)
114+
# The reference mark is taken AFTER the first build, not from its stdout
115+
# redirect: that file's mtime is when the shell opened it, which is before the
116+
# objects exist, so every object counted as "newer" and the comparison measured
117+
# nothing but timestamp ordering.
118+
sleep 1
119+
touch "$TMP/mark"
115120
MCPP_BMI_SCHEDULE=on "$MCPP" build --release > /dev/null 2>&1
116-
after=$(find target -name '*.o' -newer "$TMP/sched.txt" | wc -l)
117-
[ "$after" -eq "$before" ] \
118-
|| { echo "second build under schedule=on recompiled ($before -> $after objects)"; exit 1; }
121+
rebuilt=$(find target -name '*.o' -newer "$TMP/mark" | wc -l)
122+
[ "$rebuilt" -eq 0 ] \
123+
|| { echo "second build under schedule=on recompiled $rebuilt object(s)"; exit 1; }
119124

120125
echo "split schedule OK"

0 commit comments

Comments
 (0)