Skip to content

Fix flaky test: TestParquetFilePruning#3053

Merged
masih merged 4 commits intomainfrom
parquet-flaky-test
Mar 12, 2026
Merged

Fix flaky test: TestParquetFilePruning#3053
masih merged 4 commits intomainfrom
parquet-flaky-test

Conversation

@jewei1997
Copy link
Contributor

@jewei1997 jewei1997 commented Mar 11, 2026

Describe your changes and provide context

TestParquetFilePruning was flaky because it relied on a background pruning goroutine that fires immediately on store open. The test queried data without synchronizing with the concurrent pruning, creating a race between file deletion and DuckDB queries that failed frequently on slower hardware.

Fix:

  • Disable background pruning in the test (PruneIntervalSeconds = 0) and trigger
    PruneOldFiles synchronously instead
  • Export PruneOldFiles on parquet.Store (renamed from pruneOldFiles) to enable this
  • Add assertions that files were actually removed from disk (before vs after
    counts), making the test more thorough
  • Replace common.Big1.SetUint64(block) with new(big.Int).SetUint64(block) to avoid
    mutating a shared global

Testing performed to validate your change

go test ./sei-db/ledger_db/receipt/ -run TestParquetFilePruning -race -count=5
  -timeout 120s
go test ./sei-db/ledger_db/parquet/ -count=1 -timeout 120s
go test ./sei-db/ledger_db/receipt/ -count=1 -timeout 180s

@github-actions
Copy link

github-actions bot commented Mar 11, 2026

The latest Buf updates on your PR. Results from workflow Buf / buf (pull_request).

BuildFormatLintBreakingUpdated (UTC)
✅ passed✅ passed✅ passed✅ passedMar 12, 2026, 1:12 PM

@codecov
Copy link

codecov bot commented Mar 11, 2026

Codecov Report

❌ Patch coverage is 50.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 58.33%. Comparing base (8724492) to head (1cf1aad).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
sei-db/ledger_db/parquet/store.go 50.00% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3053      +/-   ##
==========================================
+ Coverage   58.28%   58.33%   +0.04%     
==========================================
  Files        2072     2079       +7     
  Lines      171414   170913     -501     
==========================================
- Hits        99909    99696     -213     
+ Misses      62584    62278     -306     
- Partials     8921     8939      +18     
Flag Coverage Δ
sei-chain-pr 73.84% <50.00%> (?)
sei-db 70.41% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
sei-db/ledger_db/parquet/store.go 68.78% <50.00%> (-0.61%) ⬇️

... and 245 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@jewei1997 jewei1997 enabled auto-merge (squash) March 11, 2026 16:42
@jewei1997 jewei1997 added this pull request to the merge queue Mar 12, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Mar 12, 2026
# Conflicts:
#	sei-db/ledger_db/parquet/store.go
#	sei-db/ledger_db/receipt/parquet_store_test.go
@masih
Copy link
Collaborator

masih commented Mar 12, 2026

@jewei1997 resolved conflicts on this one to unblock merging this. Since this test is flaking regularly across builds.

@masih masih enabled auto-merge March 12, 2026 13:12
@masih masih added this pull request to the merge queue Mar 12, 2026
Merged via the queue into main with commit 04faa6c Mar 12, 2026
38 checks passed
@masih masih deleted the parquet-flaky-test branch March 12, 2026 13:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants