Skip to content

Commit 40f3a0c

Browse files
committed
fix: improve flakiness check script to display first failure output
1 parent 41e84d3 commit 40f3a0c

1 file changed

Lines changed: 13 additions & 3 deletions

File tree

ci/scripts/check_flaky_pgjson_test.sh

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,18 +28,28 @@ echo ""
2828
for i in $(seq 1 "$ITERATIONS"); do
2929
# Run only the explain sqllogictest file.
3030
# The -- explain argument matches files whose path contains "explain".
31-
if cargo test \
32-
--quiet \
31+
# Capture both stdout and stderr; use the exit code of cargo test directly.
32+
output=$(cargo test \
3333
--manifest-path "$REPO_ROOT/Cargo.toml" \
3434
-p datafusion-sqllogictest \
3535
--test sqllogictests \
3636
-- explain \
37-
2>&1 | grep -q "test result: ok"; then
37+
2>&1) && cargo_exit=0 || cargo_exit=$?
38+
39+
if [[ $cargo_exit -eq 0 ]]; then
3840
STATUS="PASS"
3941
PASS=$((PASS + 1))
4042
else
4143
STATUS="FAIL"
4244
FAIL=$((FAIL + 1))
45+
# Show the failure detail on the first failure for quick diagnosis
46+
if [[ $FAIL -eq 1 ]]; then
47+
echo ""
48+
echo "--- First failure output ---"
49+
echo "$output" | tail -40
50+
echo "----------------------------"
51+
echo ""
52+
fi
4353
fi
4454

4555
RESULTS+=(" Run $i: $STATUS")

0 commit comments

Comments
 (0)