Skip to content

Commit

Permalink
fix(server): Remove context cancelled error. Fixes #3073 (#3359)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexec committed Jul 1, 2020
1 parent 74ba516 commit e4b08ab
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion server/workflow/workflow_server.go
Expand Up @@ -164,7 +164,7 @@ func (s *workflowServer) WatchWorkflows(req *workflowpkg.WatchWorkflowsRequest,
for {
select {
case <-ctx.Done():
return ctx.Err()
return nil
case event, open := <-watch.ResultChan():
if !open {
log.Debug("Re-establishing workflow watch")
Expand Down
4 changes: 2 additions & 2 deletions server/workflow/workflow_server_test.go
Expand Up @@ -621,7 +621,7 @@ func TestWatchWorkflows(t *testing.T) {
ctx, cancel := context.WithCancel(ctx)
go func() {
err := server.WatchWorkflows(&workflowpkg.WatchWorkflowsRequest{}, &testWatchWorkflowServer{testServerStream{ctx}})
assert.EqualError(t, err, "context canceled")
assert.NoError(t, err)
}()
cancel()
}
Expand All @@ -639,7 +639,7 @@ func TestWatchLatestWorkflow(t *testing.T) {
FieldSelector: util.GenerateFieldSelectorFromWorkflowName("@latest"),
},
}, &testWatchWorkflowServer{testServerStream{ctx}})
assert.EqualError(t, err, "context canceled")
assert.NoError(t, err)
}()
cancel()
}
Expand Down

0 comments on commit e4b08ab

Please sign in to comment.