lostluck commented on a change in pull request #13013:
URL: https://github.com/apache/beam/pull/13013#discussion_r499941678
##########
File path: sdks/go/pkg/beam/core/runtime/exec/sdf_test.go
##########
@@ -400,6 +400,90 @@ func TestAsSplittableUnit(t *testing.T) {
if err != nil {
t.Fatalf("invalid function: %v", err)
}
+ //wdfn, err := graph.NewDoFn(&VetWindowSdf{},
graph.NumMainInputs(graph.MainSingle))
Review comment:
rm commented out code.
##########
File path: sdks/go/pkg/beam/core/runtime/exec/sdf_test.go
##########
@@ -400,6 +400,90 @@ func TestAsSplittableUnit(t *testing.T) {
if err != nil {
t.Fatalf("invalid function: %v", err)
}
+ //wdfn, err := graph.NewDoFn(&VetWindowSdf{},
graph.NumMainInputs(graph.MainSingle))
+ //if err != nil {
+ // t.Fatalf("invalid function: %v", err)
+ //}
+ multiWindows := []typex.Window{
+ window.IntervalWindow{Start: 10, End: 20},
+ window.IntervalWindow{Start: 11, End: 21},
+ window.IntervalWindow{Start: 12, End: 22},
+ window.IntervalWindow{Start: 13, End: 23},
+ }
+
+ // Test that progress returns expected results and respects windows.
+ t.Run("Progress", func(t *testing.T) {
+ tests := []struct {
+ name string
+ fn *graph.DoFn
+ in FullValue
+ doneWork float64 // Will be output by RTracker's
GetProgress.
+ remainingWork float64 // Will be output by RTracker's
GetProgress.
+ currWindow int
+ wantProgress float64
+ }{
+ {
+ name: "SingleWindow",
+ fn: dfn,
+ in: FullValue{
+ Elm: &FullValue{
+ Elm: 1,
+ Elm2: &VetRestriction{ID:
"Sdf"},
+ },
+ Elm2: 1.0,
+ Timestamp: testTimestamp,
+ Windows: testWindows,
+ },
+ doneWork: 1.0,
+ remainingWork: 1.0,
+ currWindow: 0,
+ wantProgress: 0.5,
+ },
+ {
+ name: "MultipleWindows",
+ fn: dfn,
Review comment:
VetSdf doesn't observe windows (either explicitly or implicitly via side
input), so I'm not sure it checks the code?
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]