Skip to content

Fix 2 flaky tests#885

Open
kvch wants to merge 1 commit into
mainfrom
fix-flaky-tests
Open

Fix 2 flaky tests#885
kvch wants to merge 1 commit into
mainfrom
fix-flaky-tests

Conversation

@kvch

@kvch kvch commented Jun 11, 2026

Copy link
Copy Markdown
Collaborator

Description

This PR fixes 2 flaky tests:

  • pkg/wal/processor/transformer/wal_postgres_anon_rule_parser_test.go

Two subtests running in parallel registered a call to remove the same rules file. The error-marshaler case never creates a file, but its deferred cleanup still calls os.Remove. It can delete the success case's file before its os.Stat check runs.

  • pkg/wal/processor/webhook/notifier/webhook_notifier_test.go

The test calls ProcessWALEvent in a default branch and asserts on the last processErr when doneChan fires. Now the notifier guarantees that any ProcessWALEvent called after Notify exits will see the closed notifyDone and return the wrapped error. So the fix is to make one more ProcessWALEvent call inside the doneChan case before asserting.

Type of Change

Please select the relevant option(s):

  • 🐛 Bug fix (non-breaking change that fixes an issue)
  • ✨ New feature (non-breaking change that adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • 📚 Documentation update
  • 🔧 Refactoring (no functional changes)
  • ⚡ Performance improvement
  • 🧪 Test coverage improvement
  • 🔨 Build/CI changes
  • 🧹 Code cleanup

@kvch kvch force-pushed the fix-flaky-tests branch from 6b50fc6 to 94f8678 Compare June 11, 2026 14:42
@github-actions

Copy link
Copy Markdown

Merging this branch will not change overall coverage

Impacted Packages Coverage Δ 🤖
github.com/xataio/pgstream/pkg/wal/processor/transformer 84.90% (ø)
github.com/xataio/pgstream/pkg/wal/processor/webhook/notifier 86.61% (ø)

Coverage by file

Changed unit test files

  • github.com/xataio/pgstream/pkg/wal/processor/transformer/wal_postgres_anon_rule_parser_test.go
  • github.com/xataio/pgstream/pkg/wal/processor/webhook/notifier/webhook_notifier_test.go

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.

1 participant