Skip to content

Commit d6ccb90

Browse files
committed
Remove advance watermark steps in tests.
1 parent f869d53 commit d6ccb90

2 files changed

Lines changed: 15 additions & 16 deletions

File tree

sdks/go/pkg/beam/runners/prism/internal/engine/elementmanager.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ func (em *ElementManager) Bundles(ctx context.Context, upstreamCancelFn context.
398398

399399
// If there are no changed stages, ready processing time events,
400400
// or injected bundles available, we wait until there are.
401-
for len(em.changedStages)+len(changedByProcessingTime)+len(em.injectedBundles)+(len(em.testStreamHandler.events)-em.testStreamHandler.nextEventIndex) == 0 {
401+
for len(em.changedStages)+len(changedByProcessingTime)+len(em.injectedBundles) == 0 {
402402
// Check to see if we must exit
403403
select {
404404
case <-ctx.Done():
@@ -1633,7 +1633,8 @@ func (ss *stageState) startTriggeredBundle(em *ElementManager, key string, win t
16331633
)
16341634
slog.Debug("started a triggered bundle", "stageID", ss.ID, "bundleID", rb.BundleID, "size", len(toProcess))
16351635

1636-
//ss.bundlesToInject = append(ss.bundlesToInject, rb)
1636+
// TODO: Use ss.bundlesToInject rather than em.injectedBundles
1637+
// ss.bundlesToInject = append(ss.bundlesToInject, rb)
16371638
// Bundle is marked in progress here to prevent a race condition.
16381639
em.refreshCond.L.Lock()
16391640
em.injectedBundles = append(em.injectedBundles, rb)

sdks/go/test/integration/primitives/windowinto.go

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -217,42 +217,40 @@ func TriggerElementCount(s beam.Scope) {
217217
}, 2)
218218
}
219219

220-
// TriggerAfterProcessingTime tests the AfterProcessingTime Trigger, it fires output panes once 't' processing time has passed
220+
// TriggerAfterProcessingTimeNotTriggered tests the AfterProcessingTime Trigger. It won't fire because 't' processing time is not reached
221221
// Not yet supported by the flink runner:
222222
// java.lang.UnsupportedOperationException: Advancing Processing time is not supported by the Flink Runner.
223-
func TriggerAfterProcessingTime(s beam.Scope) {
223+
func TriggerAfterProcessingTimeNotTriggered(s beam.Scope) {
224224
con := teststream.NewConfig()
225225
con.AdvanceProcessingTime(100)
226226
con.AddElements(1000, 1.0, 2.0, 3.0)
227-
con.AdvanceWatermark(1000) // must advance watermark so that elements are processed in the downstream stages
228-
con.AdvanceProcessingTime(5000) // advance processing time to fire the trigger
229-
con.AddElements(2000, 4.0)
230-
con.AdvanceWatermark(2000)
227+
con.AdvanceProcessingTime(4999) // advance processing time but not enough to fire the trigger
228+
con.AddElements(22000, 4.0)
229+
231230
col := teststream.Create(s, con)
232231

233232
validateEquals(s.Scope("Global"), window.NewGlobalWindows(), col,
234233
[]beam.WindowIntoOption{
235234
beam.Trigger(trigger.AfterProcessingTime().PlusDelay(5 * time.Second)),
236-
}, 6.0, 4.0)
235+
}, 10.0)
237236
}
238237

239-
// TriggerAfterProcessingTime tests the AfterProcessingTime Trigger, it fires output panes once 't' processing time has passed
238+
// TriggerAfterProcessingTime tests the AfterProcessingTime Trigger. It fires output panes once 't' processing time has passed
240239
// Not yet supported by the flink runner:
241240
// java.lang.UnsupportedOperationException: Advancing Processing time is not supported by the Flink Runner.
242-
func TriggerAfterProcessingTimeNotTriggered(s beam.Scope) {
241+
func TriggerAfterProcessingTime(s beam.Scope) {
243242
con := teststream.NewConfig()
244243
con.AdvanceProcessingTime(100)
245244
con.AddElements(1000, 1.0, 2.0, 3.0)
246-
con.AdvanceWatermark(1000) // must advance watermark so that elements are processed in the downstream stages
247-
con.AdvanceProcessingTime(4999) // advance processing time but not enough to fire the trigger
248-
con.AddElements(2000, 4.0)
249-
con.AdvanceWatermark(2000)
245+
con.AdvanceProcessingTime(5000) // advance processing time to fire the trigger
246+
con.AddElements(22000, 4.0)
247+
250248
col := teststream.Create(s, con)
251249

252250
validateEquals(s.Scope("Global"), window.NewGlobalWindows(), col,
253251
[]beam.WindowIntoOption{
254252
beam.Trigger(trigger.AfterProcessingTime().PlusDelay(5 * time.Second)),
255-
}, 10.0)
253+
}, 6.0, 4.0)
256254
}
257255

258256
// TriggerRepeat tests the repeat trigger. As of now is it is configure to take only one trigger as a subtrigger.

0 commit comments

Comments
 (0)