Skip to content

CBEF-123: Keep flaky spec tests in their own list - #194

Open
davidkelly wants to merge 3 commits into
mainfrom
spec-flaky-tests
Open

davidkelly wants to merge 3 commits into
mainfrom
spec-flaky-tests

Conversation

@davidkelly

@davidkelly davidkelly commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Merge order: #194 → #192 → #193. This PR is 1 of 3 and merges first. It is based on main; #192 and #193 are stacked on it.

The issue in brief: the nightly spec run on main has failed since 2026-11-21 with no code change. Some spec tests pass in one run and fail in the next. known-failures.txt is taken from one run, so a flaky test that passed in that run is removed, and the nightly fails when it fails again.

Across four runs of the same code (the run #189's baseline came from, and the nightlies of 11-21, 11-22 and 11-23), 45 tests both passed and failed. 7 of them were not in known-failures.txt, and these are exactly the nightly's new failures. Most are in GraphUpdates (23), Transaction (10), TPC GearsOfWar (3) and ManyToManyTracking (3).

Change

  • flaky.txt lists tests that may pass or fail. compare-baseline.py ignores their outcome, and --update never writes them to known-failures.txt.
  • scripts/find-flaky.py --runs <dir> <dir> ... finds the tests that both passed and failed across several runs of the same code (one downloaded CI run per directory); --update moves them to flaky.txt.
  • flaky.txt: the 45 tests (38 of them leave known-failures.txt), less the 32 that CBEF-132: Count through the index when a query needs consistency #195 (CBEF-132) fixed: the 22 overlapping GraphUpdates and 10 Transaction tests were flaky because an unfiltered COUNT(*) ignored RequestPlus. 13 tests remain.
  • known-failures.txt: 49 entries that passed in all four runs leave. They had been kept by hand as flaky, but on this code they pass every time.
  • CONTRIBUTING.md and the spec-tests.yml header describe flaky.txt.

Tests

All four runs, including the three failed nightlies, compared with the 45-test list: no failures outside it. After the rebase onto #195, the full spec run with that fix (45306660214) compared with the 13-test list: no failures outside it, and all 32 removed tests passed there and in the filtered run 45425994911. Why the remaining 13 are flaky will be looked at separately.

Jira: CBEF-123

🤖 Generated with Claude Code

@davidkelly

Copy link
Copy Markdown
Contributor Author

Merge order for the spec-test PRs: #194 → #192 → #193, stacked in that order.

Merge one PR at a time from the bottom. GitHub retargets and rebases the next PR after each merge. Do not merge an upper PR first: the merge API for stacked PRs also merges every open PR below it.

Motivation
==========
The nightly spec run on main has failed since 2026-11-21 with no code
change. known-failures.txt is taken from one run, so a flaky test that
passed in that run is removed, and the nightly fails when it fails
again. Across four runs of the same code, 45 tests both passed and
failed; 7 of them were not listed, and they are the nightly's new
failures.

Modification
============
- flaky.txt lists tests that may pass or fail. compare-baseline.py
  ignores their outcome, and --update never writes them to
  known-failures.txt.
- scripts/find-flaky.py finds tests that both passed and failed across
  several runs of the same code; --update moves them to flaky.txt.
- flaky.txt: the 45 tests, from the baseline run and the nightlies of
  11-21 to 11-23. 38 of them leave known-failures.txt.
- known-failures.txt: 49 entries that passed in all four runs leave.
  They had been kept by hand as flaky, but they are not.
- CONTRIBUTING.md and spec-tests.yml describe flaky.txt.

Results
=======
All four runs, including the three failed nightlies, have no failures
outside the lists.
Motivation
==========
CBEF-132 (#195) made Count() exact under RequestPlus. That was the
cause of the flaky overlapping GraphUpdates and Transaction tests.

Modification
============
Remove the 22 overlapping GraphUpdates and 10 TransactionCouchbaseTest
entries from flaky.txt.

Results
=======
All 32 passed in both spec runs with the fix (45306660214 and
45425994911). The full run has no failures outside the baseline.

@emilienbev emilienbev left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice and small, and the numbers in the description add up.

Two concerns, both fine as a follow-up if you want the nightly green first.

  • A test in flaky.txt has no way out. One that starts to fail every night, or one that a fix made stable, stays invisible. The 32 entries from CBEF-132 were one real bug, so the 13 that remain may be real bugs too. Is there a ticket for them?
  • The two scripts now hold two copies of the list read and write, with slightly different rules for blank lines.

Comment thread .github/workflows/spec-tests.yml Resolved
Motivation
==========
Review of #194: a test in flaky.txt that fails every night, or that a
fix made stable, is invisible. The list code is copied between the
scripts, and a wrong --baseline path makes find-flaky create a new
header-only file. Some comments still describe the flow before
find-flaky.

Modification
============
- New scripts/testlists.py holds the default paths, the read and write
  of both lists (one rule for blank lines and trailing whitespace) and
  read_results. compare-baseline.py and find-flaky.py use it.
- compare-baseline.py lists the flaky tests that failed.
- find-flaky.py lists the flaky.txt entries that passed, or failed, in
  every run where they ran. --update is unchanged.
- Both scripts read the lists first and stop if a list they read does
  not exist. compare-baseline.py --update may still create a baseline.
- Update the known-failures header, the trx.py docstring, the
  run-suites.sh help, spec-tests.yml comments and CONTRIBUTING.md.

Results
=======
On three real runs, compare-baseline.py prints the same as before plus
the new list. Both list files round-trip byte for byte.
@davidkelly

Copy link
Copy Markdown
Contributor Author

Right now I'm assuming I'll actually have to fix something to make a flaky test stop flaking, so the commit that does that can change the flaky.txt. But... probably this needs a re-think at some point.

@davidkelly

Copy link
Copy Markdown
Contributor Author

Thanks @emilienbev. On the two points in your review:

  • The 13 remaining flaky tests: we will look at them after we add more test coverage, so there is no ticket for them yet. Until then, find-flaky now lists the flaky.txt entries that always passed or always failed, so they no longer go unseen.
  • Blank lines: fixed in 906adee. Both scripts now read the lists through one function in scripts/testlists.py, which skips blank lines and ignores trailing whitespace in both files.

@emilienbev emilienbev left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants