From a44dda6cf6939ed2514c45cec6417031c4e76e00 Mon Sep 17 00:00:00 2001 From: garrytan Date: Thu, 29 Oct 2026 16:54:50 +0000 Subject: [PATCH] fix: pre-landing review fixes gstack-flaky never greens an incomplete run: a targeted rerun needs the runner's summary proving the first run complete, otherwise (and always for generic runners) the rerun repeats the whole command. A rerun clears a test only when it exits 0 and the test passes once on its first attempt. Killed runners exit 3 (FLAKY_COMMAND_KILLED) and signals are forwarded. The first report is restored at --junit with reruns kept beside it; ids are redacted at every output; the ledger gets its own GSTACK_FLAKE_LEDGER_JUNIT; fixtures are registered in FREE_FIXTURES. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> --- bin/gstack-flaky | 47 +++---- docs/TESTING_INTERNALS.md | 3 +- docs/flaky.md | 91 +++++++++----- lib/flaky-run.ts | 195 +++++++++++++++++++---------- test/flaky-run.test.ts | 131 +++++++++++++++++-- test/helpers/free-fixtures-data.ts | 1 + 6 files changed, 335 insertions(+), 133 deletions(-) diff --git a/bin/gstack-flaky b/bin/gstack-flaky index 60039be8c..602a3d4d6 100755 --- a/bin/gstack-flaky +++ b/bin/gstack-flaky @@ -7,32 +7,35 @@ * the how-to and the error-code table. */ import * as fs from 'fs'; -import { DEFAULT_MAX_RERUNS, appendLedger, ledgerPath, renderResult, runFlaky, stepSummary } from '../lib/flaky-run'; +import { DEFAULT_MAX_RERUNS, appendLedger, ledgerPath, renderResult, runFlaky, safeText, stepSummary, workflowEscape } from '../lib/flaky-run'; import { JunitError, readJunit, type JunitRunner } from '../lib/junit'; const USAGE = `Usage: - gstack-flaky run --junit [--runner playwright|bun|generic] [--max-reruns ] - [--rerun-arg