Repository navigation
Conversation
…nizedProcessingTime in Prism
|
/gemini review |
There was a problem hiding this comment.
📋 Review Summary
This PR fixes a flake in TestTriggerAfterSynchronizedProcessingTime when running on Prism in Docker mode. By tracking afterProcessingTimeState in TriggerAfterSynchronizedProcessingTime, the trigger now waits for processing time to advance past the initial TestStream clock time (and past previous firing times on reset) instead of firing unconditionally on every split bundle.
🔍 General Feedback
- The implementation cleanly reuses
afterProcessingTimeStateand aligns well withTriggerAfterProcessingTime's state lifecycle (onElement,shouldFire,onFire,reset). - Unit tests in
strategy_test.gocover both single and repeatedTriggerAfterSynchronizedProcessingTimescenarios.
💡 Tip: Comment /gemini review on this pull request to trigger a new Gemini code review.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #41228 +/- ##
============================================
+ Coverage 57.76% 57.77% +0.01%
Complexity 2617 2617
============================================
Files 1202 1202
Lines 171675 171702 +27
Branches 2163 2163
============================================
+ Hits 99162 99198 +36
+ Misses 69851 69838 -13
- Partials 2662 2666 +4
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
/gemini review |
There was a problem hiding this comment.
📋 Review Summary
This PR resolves a flake in TestTriggerAfterSynchronizedProcessingTime on the Prism runner by testing trigger.AfterSynchronizedProcessingTime() directly without wrapping it in trigger.Repeat(...). Removing the Repeat wrapper ensures the trigger finishes after firing once per window regardless of how upstream TestStream bundles are split across channels.
🔍 General Feedback
- The change aligns
TriggerAfterSynchronizedProcessingTimewith the other leaf trigger integration tests insdks/go/test/integration/primitives/windowinto.go(such asTriggerElementCount,TriggerAfterProcessingTime, andTriggerNever) and makes the expected 2-pane count deterministic across bundle boundaries.
💡 Tip: Comment /gemini review on this pull request to trigger a new Gemini code review.
Note: this PR was auto-generated by tooling. Before moving it out of draft, the author has done a full review of the PR, specifically evaluating it on the following criteria:
Full details of the methodology of generation and review can be found here - https://docs.google.com/document/d/14lj7ECVov4T4EdwmIzNlWrRGE3lLDMOwX5xUMGzaLoc/edit?usp=sharing
If you have concerns with the PR or with the underlying methodology used to generate this, please comment below - they will be addressed by the author not the tooling :)
Summary
:sdks:go:test:prismValidatesRunner(TestTriggerAfterSynchronizedProcessingTimefailing withexpected 2 collections, but got: 3in https://github.com/apache/beam/actions/runs/43083145592 and https://github.com/apache/beam/actions/runs/43099848241).strategy.go),TriggerAfterSynchronizedProcessingTimefires immediately upon receiving data (shouldFirereturns!ts.finished) and marks the trigger finished.TriggerAfterSynchronizedProcessingTimeinsdks/go/test/integration/primitives/windowinto.gowrappedtrigger.AfterSynchronizedProcessingTime()intrigger.Repeat(...)(unlike the other leaf trigger tests inwindowinto.go), which resetts.finished = falseafter each firing and caused the GBK to fire once per upstream bundle. Wheneverstage.Executechannel-split the initial 3-elementTestStreambundle(1.0, 2.0, 3.0)into two pre-combined bundles in Docker mode,Repeat(AfterSynchronizedProcessingTime())fired twice for window[0, 10000)and once for window[10000, 20000)(3panes instead of2).trigger.AfterSynchronizedProcessingTime()directly withouttrigger.Repeat(...)so it fires once per window and deterministically emits 2 panes.Test Plan
go test ./pkg/beam/runners/prism/...go test -v ./test/integration/primitives -run "TestTrigger.*"Verification
beam_PreCommit_GoPrism.ymlworkflow run on branch:43369539492