Description
For some of our tests, go test with -count=1 passes but with -count=2 fails.
Your environment
- Go version: go1.24.1
- macOS 15.6.1 M1
- Gno commit hash 6020f0b (latest master)
Steps to reproduce
In the root of the gno repo, enter:
go test -v ./tm2/pkg/bft/consensus/... -run TestHandshakeReplayOne -count=2
Expected behaviour
This should pass because it passes with -count=1:
go test -v ./tm2/pkg/bft/consensus/... -run TestHandshakeReplayOne -count=1
Actual behaviour
It fails with -count=2
Logs
Test failure message:
=== RUN TestHandshakeReplayOne
=== PAUSE TestHandshakeReplayOne
=== CONT TestHandshakeReplayOne
--- PASS: TestHandshakeReplayOne (1.73s)
=== RUN TestHandshakeReplayOne
=== PAUSE TestHandshakeReplayOne
=== CONT TestHandshakeReplayOne
2026/02/03 15:24:05 [JOB 1] WAL file /var/folders/3w/qv9qtdc16l15sl9pjgd305000000gn/T/58442887/test-chain-consensus_reactor_test_4023314544/db/replay_test_5_0_t/kvstore.db/000002.log with log number 000002 stopped reading at offset: 698; replayed 7 keys in 7 batches
2026/02/03 15:24:05 [JOB 1] WAL file /var/folders/3w/qv9qtdc16l15sl9pjgd305000000gn/T/58442887/test-chain-consensus_reactor_test_4023314544/db/replay_test_5_0_a/kvstore.db/000002.log with log number 000002 stopped reading at offset: 698; replayed 7 keys in 7 batches
replay_test.go:563: Error on abci handshake: error on replay: App block height (11) is higher than core (6)
--- FAIL: TestHandshakeReplayOne (0.28s)
FAIL
FAIL github.com/gnolang/gno/tm2/pkg/bft/consensus 2.347s
? github.com/gnolang/gno/tm2/pkg/bft/consensus/config [no test files]
? github.com/gnolang/gno/tm2/pkg/bft/consensus/pb [no test files]
testing: warning: no tests to run
PASS
ok github.com/gnolang/gno/tm2/pkg/bft/consensus/types 0.464s [no tests to run]
? github.com/gnolang/gno/tm2/pkg/bft/consensus/types/pb [no test files]
FAIL
Proposed solution
This test does have t.Parallel(). But when I remove this line the test still fails, so maybe this isn't the problem.
Description
For some of our tests,
go testwith-count=1passes but with-count=2fails.Your environment
Steps to reproduce
In the root of the gno repo, enter:
Expected behaviour
This should pass because it passes with
-count=1:Actual behaviour
It fails with
-count=2Logs
Test failure message:
Proposed solution
This test does have
t.Parallel(). But when I remove this line the test still fails, so maybe this isn't the problem.