extrafunctional

Flaky tests, reproduced · Go

nats-io/nats-server

A coding agent signed this repository up for fplus-dst from one prompt. It chose tests by their sources of non-determinism and, from a scan of CI's history, the tests CI saw fail and then pass. fplus-dst built each test as CI does and ran it in a deterministic simulator with timing faults. Reproduced: it failed here with CI's own error. Found by search: it failed here, and CI has no record of that failure. Nothing found: searched, and the test held up.

GitHub

Reproduce this in your account

Paste one prompt into your coding agent, in a checkout of nats-io/nats-server. It reads this repository's runbook: the tests above, the commits they ran at and how to build the image, then makes them fail in your own account, with $50 of free credit.

Set up f+ DST for nats-io/nats-server from https://staging.extrafunctional-staging.fyi/dst/nats-io/nats-server.md

Flaky tests reproduced

5 of 9

  • 5 reproduced
  • 4 nothing found

One square for each flaky test. Reproduced: it failed here the way CI saw it fail. Nothing found: no failure in the hours searched, which is not a pass; a search whose faults never reached the test proves nothing.

Median time to reproduce

15.4 min

10 s1 min10 min1 h

Fastest 85 s, slowest 42.4 min. One dot for each of the 4 runs with a time on record, on a log scale; the line is the median.

Reached each stage
intake9image9baseline9search9replay5shrink5report5
Replays bit-exact

5 of 5

The same fingerprint on every replay of the failing schedule.

Found by
stolen time3locate2

The kind of search that first made each one fail.

Flaky tests

Status
Found by
From
10 of 10
Test, and what CI saidCI flakes
CI's flaky testsEach failed and then passed at one commit in CI; hunted at CI's commit.
1reproduced TestJWTAccountNATSResolverWrongCredsjwt_test.go:7377: require no error, but got: stat /tmp/TestJWTAccountNATSResolverWrongCreds2926843114/006/AC5DHMJB4SMRVSWSP6BMLCYO6TBGXPCO7JCVQR2DXVUZAM6XFKXPWMGG.jwt: no such file or directory 42.4 min stolen time ✓ bit-exactno fix yet –

The failing schedule

✓ bit-exact replay · fingerprint

01447 M guest branches

15 steals of CPU time, placed by guest branch count, the schedule's own unit; taller is longer (log scale), the longest 196 ms.

In CI

intake

CI's failing runhttps://github.com/nats-io/nats-server/actions/runs/45223304696/job/137864842879
CI symptomjwt_test.go:7377: require no error, but got: stat /tmp/TestJWTAccountNATSResolverWrongCreds2926843114/006/AC5DHMJB4SMRVSWSP6BMLCYO6TBGXPCO7JCVQR2DXVUZAM6XFKXPWMGG.jwt: no such file or directory
CI's passing run, same commithttps://github.com/nats-io/nats-server/actions/runs/45223304696/job/137873446484

image

commit5a7a03c33d5874da6e83e1d0496527834cd8b62e

search

first failure2543 s (blind stolen time, seed 133)
the test's own errorjwt_test.go:7378: require no error, but got: stat /tmp/TestJWTAccountNATSResolverWrongCreds2268594682/005/ACO2SXC34IVZLFDDLVLX4RTVC2KXP6N3BMR7HMTCXKF5HMJGWFR36PE5.jwt: no such file or directory

replay

schedulestx=41887169:16585,121278817:196145,207940079:19364,393166515:17300,522450974:45834,586674585:16888,690558306:48288,751355778:13679,865218191:71497,1108251362:77633,1205607871:1827,1206184517:114236,1230280765:1515,1249444460:19062,1391202558:2717,1455137897:6679,1469179930:4442 | run
replaysVIOLATION a605b8f29b05b9ac ; VIOLATION a605b8f29b05b9ac
same failure as CImatches CI shows CI's assertion (given CI's line)

shrink

minimal schedulestx=41887169:16585,121278817:196145,207940079:19364,393166515:17300,522450974:45834,586674585:16888,690558306:48288,751355778:13679,865218191:71497,1108251362:77633,1205607871:1827,1206184517:114236,1230280765:1515,1249444460:19062,1391202558:2717 | run

report

versus CICI failed at jwt_test.go:7377, here at 7378: the next require of the same kind, both reporting the account's .jwt file missing from the resolver directory.
2reproduced TestGatewayTLSMixedIPAndDNSgateway_test.go:689: Expected 1 outbound gateway(s), got 0 (ulimit -n too low?) 25.8 min locate ✓ bit-exactno fix yet –

The failing schedule

✓ bit-exact replay · fingerprint

0729 M guest branches

16 steals of CPU time, placed by guest branch count, the schedule's own unit; taller is longer (log scale), the longest 753 ms.

In CI

intake

CI's failing runhttps://github.com/nats-io/nats-server/actions/runs/45202998227/job/137842770493
CI symptomgateway_test.go:689: Expected 1 outbound gateway(s), got 0 (ulimit -n too low?)
CI's passing run, same commithttps://github.com/nats-io/nats-server/actions/runs/45202998227/job/137850398391

image

commitc86d29d883f429a9c177d0b8d56da9d008bd1207

search

first failure1550 s (aimed search)
the test's own error--- FAIL: TestGatewayTLSMixedIPAndDNS (16.94s)

replay

schedulestx=15298149:540754,37398808:1762,84946436:58076,143029996:753356,184888552:2244,193979056:27542,197219658:2761,276561460:5140,287205851:374973,487133483:247742,512793821:748170,653726316:3373,694539924:17100,695784485:39174,699249955:1274,700744444:18450,837398997:2109 | run
replaysVIOLATION db02c1c8b4224876 ; VIOLATION db02c1c8b4224876
same failure as CImatches CI shows CI's assertion (given CI's line)

shrink

minimal schedulestx=15298149:540754,37398808:1762,84946436:58076,143029996:753356,184888552:2244,193979056:27542,197219658:2761,276561460:5140,287205851:374973,487133483:247742,512793821:748170,653726316:3373,694539924:17100,695784485:39174,699249955:1274,700744444:18450 | run
3reproduced TestStressChainedSolicitWorksexact match route_discovery_test.go:253: Expecting 3 routes, got 2 – locate ✓ bit-exactno fix yet –

The failing schedule

✓ bit-exact replay · fingerprint

01.5 s

pause of workload/test.test for 20 ms, 1.5 s after the step started.

In CI

intake

CI's failing runhttps://github.com/nats-io/nats-server/actions/runs/44986168704/job/137097094869
CI symptomroute_discovery_test.go:434: [/home/runner/work/nats-server/nats-server/src/github.com/nats-io/nats-server/test/route_discovery_test.go:253] Expecting 3 routes, got 2
CI's passing run, same commithttps://github.com/nats-io/nats-server/actions/runs/44867342036/job/136733853278

image

commita0385c9af342ffae6df28999b77a85de5423d3d6

baseline

CPU speedstb=2

search

reproduced125 of 367 locate schedules (34 %) failed, every one with CI's line; the first at schedule 2-4 (a 20 ms pause of the test process). Blind stolen time: 0 of 457.

replay

schedulestb=2 | run P=workload/test.test@0~1482:20
replaysVIOLATION fb43df1512ba85be ; VIOLATION fb43df1512ba85be
same failure as CIYES (route_discovery_test.go:434: Expecting 3 routes, got 2)

report

relabelledFirst reported as not reproduced: the symptom matcher required CI's /home/runner/... path. A rescan of the kept runs found the hits; the matcher is fixed. Replayed 2/2 on an image rebuilt at the same commit (the original was evicted), at the slower calibrated CPU speed stb=2, where the fault-free baseline passes.
4reproduced TestJetStreamClusterDesyncAfterDiskResetDuringRolloutjetstream_cluster_2_test.go:9472: require no error, but got: [TEST] Expected 5 Replicas, got 4 4.9 min stolen time ✓ bit-exactno fix yet –

The failing schedule

✓ bit-exact replay · fingerprint

01603 M guest branches

9 steals of CPU time, placed by guest branch count, the schedule's own unit; taller is longer (log scale), the longest 289 ms.

In CI

intake

CI's failing runhttps://github.com/nats-io/nats-server/actions/runs/45143988709/job/137791172837
CI symptomjetstream_cluster_2_test.go:9472: require no error, but got: [TEST] Expected 5 Replicas, got 4
CI's passing run, same commithttps://github.com/nats-io/nats-server/actions/runs/45143988709/job/137814484454

image

commite94ae7da894d41f9b0355c63bceda8437fad2564

search

first failure296 s (blind stolen time, seed 22)
the test's own errorjetstream_cluster_2_test.go:9472: require no error, but got: [TEST] Expected 5 Replicas, got 4

replay

schedulestx=181200622:12523,386922291:25116,400588571:13558,564653263:10903,687677147:7479,833297794:1489,948842736:39445,1199300791:1543,1541102535:289027,1597062274:559304 | run
replaysVIOLATION 31fac6d5abe71ac9 ; VIOLATION 31fac6d5abe71ac9
same failure as CImatches CI shows CI's assertion (given CI's line)

shrink

minimal schedulestx=181200622:12523,386922291:25116,400588571:13558,564653263:10903,687677147:7479,833297794:1489,948842736:39445,1199300791:1543,1541102535:289027 | run
5reproduced TestJetStreamClusterLeafnodeSpokesjetstream_cluster_2_test.go:502: Expected a cluster peer count of 9, got 10 85 s stolen time ✓ bit-exactno fix yet –

The failing schedule

✓ bit-exact replay · fingerprint

01681 M guest branches

6 steals of CPU time, placed by guest branch count, the schedule's own unit; taller is longer (log scale), the longest 799 ms.

In CI

intake

CI's failing runhttps://github.com/nats-io/nats-server/actions/runs/45143988709/job/137811931384
CI symptomjetstream_cluster_2_test.go:502: Expected a cluster peer count of 9, got 10
CI's passing run, same commithttps://github.com/nats-io/nats-server/actions/runs/45143988709/job/137814484454

image

commite94ae7da894d41f9b0355c63bceda8437fad2564

search

first failure85 s (blind stolen time, seed 3)
the test's own error--- FAIL: TestJetStreamClusterLeafnodeSpokes (32.76s)

replay

schedulestx=26374552:330291,483455815:21643,605337493:34980,1062561577:112662,1254480152:9493,1451007005:406040,1584553382:2938,1616767223:798945 | run
replaysVIOLATION ca952832a95375aa ; VIOLATION ca952832a95375aa
same failure as CImatches CI shows CI's assertion (given CI's line)

shrink

minimal schedulestx=26374552:330291,483455815:21643,1062561577:112662,1254480152:9493,1451007005:406040,1616767223:798945 | run
Proactive huntsTests the onboarding agent chose for their sources of non-determinism, hunted with timing faults.
6reproduced TestStressChainedSolicitWorksexact match route_discovery_test.go:253: Expecting 3 routes, got 2 – stolen time ✓ bit-exactno fix yet –

The same flaky test as row 3, run again by the batch; counted once.

The failing schedule

✓ bit-exact replay · fingerprint

0789 M guest branches

7 steals of CPU time, placed by guest branch count, the schedule's own unit; taller is longer (log scale), the longest 404 ms.

In CI

intake

kindproactive
whynetwork: chained route solicitation and gossip discovery over TCP; flaked in CI on route count on 2026-11-22
in CICI saw this exact failure on 2026-11-22 at a0385c9a (route_discovery_test.go:253: Expecting 3 routes, got 2), and the same job passed on a re-run: https://github.com/nats-io/nats-server/actions/runs/44986168704/job/137097094869

image

commit5a7a03c33d5874da6e83e1d0496527834cd8b62e

search

the test's own failureroute_discovery_test.go:434: [/src/test/route_discovery_test.go:253] Expecting 3 routes, got 2
found byblind stolen time
at CI's commitThe hunt of CI's own record, at a0385c9a, also reproduced it: 125 of 367 locate schedules (listed under CI's flaky tests).

replay

schedulestx=107496460:25379,204464170:2444,256344758:192715,453830669:404417,469540878:8662,496209775:130958,524989553:2097,566607726:152529,597822691:55487,755181587:38725,758607668:4007 | run
fingerprint5df494b000613c0d
replays2, one fingerprint
image sha256aa1496e28192fbca75f224e542ad85614bc3e61dae6c38e548bb7b5b6fd3c81b

shrink

minimal schedulestx=107496460:25379,453830669:404417,469540878:8662,496209775:130958,597822691:55487,755181587:38725,758607668:4007 | run
faultno disk faults
faultCPU steal of 25.379 ms at guest branch 107M (guest time 4.002 s)
faultCPU steal of 404.417 ms at guest branch 454M (guest time 6.033 s)
faultCPU steal of 8.662 ms at guest branch 470M (guest time 6.111 s)
faultCPU steal of 130.958 ms at guest branch 496M (guest time 6.326 s)
faultCPU steal of 55.487 ms at guest branch 598M (guest time 6.857 s)
7nothing found: no failure (hours not recorded yet) TestJetStreamClusterStreamLeaderStepDown – – – –

The failing schedule

In CI

intake

kindproactive
whythread: stream leader step-down and re-election across a 3-node JetStream cluster while clients publish and read

image

commit5a7a03c33d5874da6e83e1d0496527834cd8b62e

search

searched3533 s
schedules25
faults triedthread preemption (CPU steals), thread pauses
partialA partial search: the host was overloaded by other builds (load near 480 on 96 threads), so it ran far fewer schedules than a full hour gives. A clean re-run is queued.
8nothing found: no failure (hours not recorded yet) TestNRGSimpleElection – – – –

The failing schedule

In CI

intake

kindproactive
whytimer: Raft leader election depends on randomized election timers and goroutine scheduling across three in-process nodes

image

commit5a7a03c33d5874da6e83e1d0496527834cd8b62e

search

searched3532 s
schedules22
faults triedthread preemption (CPU steals), thread pauses
partialA partial search: the host was overloaded by other builds (load near 480 on 96 threads), so it ran far fewer schedules than a full hour gives. A clean re-run is queued.
9nothing found: no failure (hours not recorded yet) TestJetStreamConsumerMaxDeliveryAndServerRestart – – – –

The failing schedule

In CI

intake

kindproactive
whytimer: consumer redelivery (AckWait/MaxDeliver) timers racing a server restart and filestore recovery; deflaked recently

image

commit5a7a03c33d5874da6e83e1d0496527834cd8b62e

search

searched2519 s
schedules236
faults triedthread preemption (CPU steals), thread pauses
10nothing found: no failure (hours not recorded yet) TestJetStreamClusterAccountUsageDrifts – – – –

The failing schedule

In CI

intake

kindproactive
whythread: account usage accounting replicated across cluster nodes via async updates; fixed as flaky recently

image

commit5a7a03c33d5874da6e83e1d0496527834cd8b62e

search

searched2517 s
schedules227
faults triedthread preemption (CPU steals), thread pauses

In our own words

onboarding2026-11-24 00:20 EST by a fresh coding agent given one prompt; again at 01:49 by another, which also scanned CI's history.
recipeGo 1.26.11 (go.mod's pin); one test run as CI's scripts/runTestsOnTravis.sh runs it: go test -v -p=1 -count=1 -vet=off, no -race (as on main). Checked offline: TestNRGSimpleElection passed in 4.1 s.
targetsFive, picked by source of non-determinism: Raft election timers (TestNRGSimpleElection), cluster leader failover (TestJetStreamClusterStreamLeaderStepDown), redelivery timers racing a restart (TestJetStreamConsumerMaxDeliveryAndServerRestart, de-flaked recently), async replicated accounting (TestJetStreamClusterAccountUsageDrifts, flake fixed recently), route gossip (TestStressChainedSolicitWorks, flaked in CI on 2026-11-22). The second agent added catch-up and node-restart tests. Two extra picks were stopped unrun overnight to give the queue to the CI-flake hunts.
result5 of 9 hunted tests made to fail.
CI historyCI scan: 3 days of GitHub Actions, 434 jobs; 5 tests proved flaky (failed, then passed on a re-run at one commit), each queued at CI's commit.