Skip to content

Fix flaky test: TestParquetFilePruning#3053

Open
jewei1997 wants to merge 2 commits intomainfrom
parquet-flaky-test
Open

Fix flaky test: TestParquetFilePruning#3053
jewei1997 wants to merge 2 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 11, 2026, 4:43 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 (30f8b0a) to head (a2fde15).

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.36%   58.33%   -0.03%     
==========================================
  Files        2079     2079              
  Lines      171899   171883      -16     
==========================================
- Hits       100321   100265      -56     
- Misses      62637    62672      +35     
- Partials     8941     8946       +5     
Flag Coverage Δ
sei-chain-pr 73.95% <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 69.36% <50.00%> (-0.31%) ⬇️

... and 26 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
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.

3 participants