eventservice: stabilize signal resolved table trigger test
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 56
- Forks
- 63
- Avg merge
- 2d 20h
- Merged PRs (30d)
- 34
Description
Bug report
TestProcessTableTriggerDispatcherSendsSignalResolvedWhenNoForwardRangeAndNotInCommitStage is brittle and can look flaky when the surrounding implementation changes.
Background
The test is intended to verify the table trigger dispatcher behavior when there is no forward range and the changefeed is not in the syncpoint commit stage. In that case, the dispatcher should send a signal resolved event without advancing past the current watermark.
Problem
The current test couples that behavior to two unrelated implementation details:
- It assumes the dispatcher is still unhandshaked, so the first message must be a
HandshakeEvent. - It uses
time.Now().Add(...)to bypass the resolved-ts rate limit, which makes the setup depend on wall clock timing instead of deterministic state.
Because of that, the test is validating more than its name suggests, and it becomes fragile under benign changes to handshake timing or resolved-ts throttling.
Expected behavior
The test should only assert the behavior it is named after:
- a signal resolved event is emitted when there is no forward range
- the resolved watermark stays at the current value
nextSyncPointis unchanged
Suggested fix
Make the test deterministic by:
- pre-marking the dispatcher as handshaked so handshake ordering is out of scope
- using a zero
lastSentResolvedTsTimeto bypass the rate limit deterministically - asserting only the emitted resolved event and the relevant watermark state
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with TestProcessTableTriggerDispatcherSendsSignalResolvedWhenNoForwardRangeAndNotInCommitStage and the table trigger dispatcher setup. Make the test independent of handshake ordering and wall-clock timing, then verify that it emits the resolved event, preserves the current resolved watermark, and leaves nextSyncPoint unchanged.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- testing-qa
- Issue type
- Refactor
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 78/100