[ 
https://issues.apache.org/jira/browse/BEAM-14346?focusedWorklogId=760235&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-760235
 ]

ASF GitHub Bot logged work on BEAM-14346:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 21/Apr/22 17:21
            Start Date: 21/Apr/22 17:21
    Worklog Time Spent: 10m 
      Work Description: lostluck commented on code in PR #17425:
URL: https://github.com/apache/beam/pull/17425#discussion_r855418177


##########
sdks/go/pkg/beam/core/runtime/exec/fn_test.go:
##########
@@ -181,20 +208,28 @@ func TestInvoke(t *testing.T) {
                        }
 
                        val, err := Invoke(context.Background(), 
typex.NoFiringPane(), window.SingleGlobalWindow, ts, fn, test.Opt, nil, 
test.Args...)
-                       if err != nil {
-                               t.Fatalf("Invoke(%v,%v) failed: %v", 
fn.Fn.Name(), test.Args, err)
-                       }
-                       if val != nil && val.Elm != test.Expected {
-                               t.Errorf("Invoke(%v,%v) = %v, want %v", 
fn.Fn.Name(), test.Args, val.Elm, test.Expected)
-                       }
-                       if val != nil && val.Elm2 != test.Expected2 {
-                               t.Errorf("Elm2: Invoke(%v,%v) = %v, want %v", 
fn.Fn.Name(), test.Args, val.Elm2, test.Expected2)
-                       }
-                       if val != nil && val.Timestamp != test.ExpectedTime {
-                               t.Errorf("EventTime: Invoke(%v,%v) = %v, want 
%v", fn.Fn.Name(), test.Args, val.Timestamp, test.ExpectedTime)
-                       }
-                       if val != nil && val.Continuation != 
test.ExpectedContinuation {
-                               t.Errorf("EventTime: Invoke(%v,%v) = %v, want 
%v", fn.Fn.Name(), test.Args, val.Continuation, test.ExpectedContinuation)
+
+                       switch test.ExpectedError != nil {
+                       case true:

Review Comment:
   When it's a boolean, consider just using if/else. `case true` may be valid 
but it's a smell of something weird.





Issue Time Tracking
-------------------

    Worklog Id:     (was: 760235)
    Time Spent: 1h  (was: 50m)

> ret2() function checks incorrect index for error case
> -----------------------------------------------------
>
>                 Key: BEAM-14346
>                 URL: https://issues.apache.org/jira/browse/BEAM-14346
>             Project: Beam
>          Issue Type: Improvement
>          Components: sdk-go
>            Reporter: Jack McCluskey
>            Assignee: Jack McCluskey
>            Priority: P1
>          Time Spent: 1h
>  Remaining Estimate: 0h
>
> The updated ret2() function is checking a non-existent index (2) for errors 
> when it should be checking index 1. 



--
This message was sent by Atlassian Jira
(v8.20.7#820007)

Reply via email to