Repository navigation
Require processing time advancement before firing TriggerAfterSynchronizedProcessingTime in Prism - #41228
Require processing time advancement before firing TriggerAfterSynchronizedProcessingTime in Prism#41228damccorm wants to merge 1 commit into
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:
|
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).TriggerAfterSynchronizedProcessingTimein Prism hadshouldFirereturn!ts.finishedwithout checking whether processing time had advanced past the initial clock time (or past the previous firing time when wrapped inTriggerRepeatedly).TestTriggerAfterSynchronizedProcessingTime(which usestrigger.Repeat(trigger.AfterSynchronizedProcessingTime())without advancingTestStreamprocessing time), wheneverstage.Executechannel-split the initial 3-elementTestStreambundle into two bundles in Docker mode,Repeat(AfterSynchronizedProcessingTime())fired once on each split bundle in window[0, 10000), emitting 3 panes total instead of 2.afterProcessingTimeStateinTriggerAfterSynchronizedProcessingTimeso it requires processing time to advance past the initialTestStreamclock time (mtime.FromTime(time.Time{})) before firing, and advancesfiringTimetos.emNow + 1onresetwhen repeated.Test Plan
go test ./pkg/beam/runners/prism/...go test -v ./test/integration/primitives -run "TestTrigger.*"./gradlew :runners:prism:java:prismLoopbackValidatesRunnerTests --tests "org.apache.beam.sdk.transforms.GroupByKeyTest*" --tests "org.apache.beam.sdk.testing.TestStreamTest"Verification
beam_PreCommit_GoPrism.ymlworkflow run on branch:43119696481