github-actions[bot] commented on code in PR #41794:
URL: https://github.com/apache/beam/pull/41794#discussion_r4743266495
##########
sdks/go/pkg/beam/runners/prism/internal/engine/elementmanager_test.go:
##########
@@ -1128,3 +1128,34 @@ func TestElementManager_ClearProcessingTimeTimer(t
*testing.T) {
}
})
}
+
+func TestAggregateBuildProcessingTimeBundle_GarbageCollectedWindow(t
*testing.T) {
+ em := NewElementManager(Config{})
+ ss := makeStageState("agg", nil, nil, nil)
+ ss.kind = &aggregateStageKind{}
+ ss.strat = WinStrat{}
Review Comment:
**🟢 Low**: `WinStrat{}` leaves `Trigger` as `nil`. Without the new
`winState, ok` guard, calling `buildProcessingTimeBundle` with `WinStrat{}`
would panic with a nil-pointer dereference inside `ss.strat.IsTriggerReady`
(`ws.Trigger.onElement(...)`) rather than reproducing the production
`assignment to entry in nil map` panic at `winState[string(e.keyBytes)] =
state`. Setting a real trigger (such as `TriggerAfterEndOfWindow{}` or
`DefaultTrigger()`) ensures the test exercises the exact failure path.
```suggestion
ss.strat = WinStrat{Trigger: &TriggerAfterEndOfWindow{}}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]