Skip to content

test: address flake in HeadRevisionDoesNotConsumeXID#3163

Merged
tstirrat15 merged 3 commits into
mainfrom
tstirrat/remove-flaking-xid-test
Jun 11, 2026
Merged

test: address flake in HeadRevisionDoesNotConsumeXID#3163
tstirrat15 merged 3 commits into
mainfrom
tstirrat/remove-flaking-xid-test

Conversation

@tstirrat15

Copy link
Copy Markdown
Contributor

Description

This test has been flaking: https://github.com/authzed/spicedb/actions/runs/27164166509/job/80187393099?pr=3154

Relaxing the assertion slightly should help.

Changes

  • Use a leq assertion instead of an equality assertion

Testing

Review.

@tstirrat15 tstirrat15 requested a review from a team as a code owner June 8, 2026 20:29
@github-actions github-actions Bot added area/datastore Affects the storage system area/tooling Affects the dev or user toolchain (e.g. tests, ci, build tools) labels Jun 8, 2026
@codecov

codecov Bot commented Jun 8, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@github-actions github-actions Bot 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.

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 2.

Benchmark suite Current: ea8450c Previous: f1ae3b8 Ratio
BenchmarkDatastoreDriver/cockroachdb-overlap-static/TestTuple/SnapshotReverseRead (github.com/authzed/spicedb/internal/datastore/benchmark) 34167382 ns/op 174789 B/op 20200 allocs/op 7776957 ns/op 172930 B/op 20196 allocs/op 4.39
BenchmarkDatastoreDriver/cockroachdb-overlap-static/TestTuple/SnapshotReverseRead (github.com/authzed/spicedb/internal/datastore/benchmark) - ns/op 34167382 ns/op 7776957 ns/op 4.39
BenchmarkDatastoreDriver/cockroachdb-overlap-insecure/TestTuple/SnapshotReverseRead (github.com/authzed/spicedb/internal/datastore/benchmark) 33394895 ns/op 173775 B/op 20199 allocs/op 7562874 ns/op 172825 B/op 20195 allocs/op 4.42
BenchmarkDatastoreDriver/cockroachdb-overlap-insecure/TestTuple/SnapshotReverseRead (github.com/authzed/spicedb/internal/datastore/benchmark) - ns/op 33394895 ns/op 7562874 ns/op 4.42

This comment was automatically generated by workflow using github-action-benchmark.

@tstirrat15 tstirrat15 force-pushed the tstirrat/remove-flaking-xid-test branch 2 times, most recently from ef492e5 to 70a95ec Compare June 8, 2026 20:48
@tstirrat15 tstirrat15 enabled auto-merge (squash) June 8, 2026 23:31
after := nextXID()

require.Equal(t, before, after, "HeadRevision burned %d xid(s) over %d calls; expected 0", after-before, iterations)
// NOTE: we're expecting <= 1 here because there's a heartbeat goroutine that increments

@miparnisari miparnisari Jun 9, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

before we do this relaxation, can we try something else? add cmd = append(cmd, "-c", "autovacuum=off") in line 66 inside RunPostgresForTestingWithCommitTimestamps. I assume that none of the existing tests depend on this vacuum process (@josephschorr ?)

my suspicion is that the vacuum processing is what is burning this extra XID.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Let's try it - see if it does remove the flake

@miparnisari miparnisari changed the title chore: address flake in xid test test: address flake in HeadRevisionDoesNotConsumeXID Jun 10, 2026
@tstirrat15 tstirrat15 force-pushed the tstirrat/remove-flaking-xid-test branch from 70a95ec to b665427 Compare June 11, 2026 18:19
@tstirrat15 tstirrat15 force-pushed the tstirrat/remove-flaking-xid-test branch from b665427 to ea8450c Compare June 11, 2026 18:21
@github-actions github-actions Bot removed area/datastore Affects the storage system area/tooling Affects the dev or user toolchain (e.g. tests, ci, build tools) labels Jun 11, 2026
@tstirrat15 tstirrat15 merged commit 15e8dc2 into main Jun 11, 2026
170 of 176 checks passed
@tstirrat15 tstirrat15 deleted the tstirrat/remove-flaking-xid-test branch June 11, 2026 19:17
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 11, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants