Skip to content

test(db): stabilize delayed checkpoint - #1498

Open
corylanou wants to merge 1 commit into
mainfrom
issue-1495-test-db-testdb-delayedcheckpointafterwrite-is-sleep-timed-an
Open

test(db): stabilize delayed checkpoint#1498
corylanou wants to merge 1 commit into
mainfrom
issue-1495-test-db-testdb-delayedcheckpointafterwrite-is-sleep-timed-an

Conversation

@corylanou

Copy link
Copy Markdown
Collaborator

Description

Rework the delayed-checkpoint regression test so it controls checkpoint eligibility explicitly and waits for TXID advancement with a bounded condition poll.

The test now verifies the write sync advances replication before enabling a later time-based checkpoint. Production checkpoint behavior is unchanged.

Motivation and Context

The failed CI attempt showed the initial checkpoint's post-processing outliving the test's 100 ms interval. The supposedly immediate write sync therefore performed the checkpoint early (insert=4), leaving the later sync at the same TXID (delayed=4). The retry passed, confirming the runner-speed dependency.

In scope: deterministic checkpoint setup, eligibility control, bounded polling, and diagnostic timeout output.

Out of scope: production checkpoint logic and unrelated concurrent-write test logging.

Fixes #1495

How Has This Been Tested?

go build ./...
go test ./...
go test -race ./...
go test -race . -run '^TestDB_DelayedCheckpointAfterWrite$' -count=30
pre-commit run --all-files
golangci-lint run --new-from-rev=origin/main

The original failure was also reproduced deterministically before the rewrite, yielding insert=4 delayed=4.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (would cause existing functionality to not work as expected)

Checklist

  • My code follows the code style of this project (go fmt, go vet)
  • I have tested my changes (go test ./...)
  • I have updated the documentation accordingly (if needed)

@github-actions

Copy link
Copy Markdown

PR Build Metrics

All clear — no issues detected

Check Status Summary
Binary size 37.18 MB (0.0 KB / 0.00%)
Dependencies No changes
Vulnerabilities None detected
Go toolchain 1.25.14 (latest)
Module graph 1230 edges (0)

Binary Size

Size Change
Base (4ed7a30) 37.18 MB
PR (bf71f78) 37.18 MB 0.0 KB (0.00%)

Dependency Changes

No dependency changes.

govulncheck Output

=== Symbol Results ===

No vulnerabilities found.

Your code is affected by 0 vulnerabilities.
This scan also found 1 vulnerability in packages you import and 2
vulnerabilities in modules you require, but your code doesn't appear to call
these vulnerabilities.
Use '-show verbose' for more details.

Build Info

Metric Value
Build time 45s
Go version go1.25.14
Commit bf71f78

🤖 Updated on each push.

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.

test(db): TestDB_DelayedCheckpointAfterWrite is sleep-timed and flakes on CI

1 participant