Skip to content
This repository has been archived by the owner on Oct 9, 2023. It is now read-only.

Commit

Permalink
test failure in executor
Browse files Browse the repository at this point in the history
Signed-off-by: Babis Kiosidis <[email protected]>
  • Loading branch information
ckiosidis committed Aug 25, 2022
1 parent 7bb6b59 commit 7813240
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/controller/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ func (p *Propeller) Handle(ctx context.Context, namespace, name string) error {
t := p.metrics.RoundTime.Start(ctx)
mutatedWf, err := p.TryMutateWorkflow(ctx, w)

if wfClosureCrdFields != nil {
if wfClosureCrdFields != nil {
// strip data populated from WorkflowClosureReference
w.SubWorkflows, w.Tasks, w.WorkflowSpec = nil, nil, nil
if mutatedWf != nil {
Expand Down
20 changes: 20 additions & 0 deletions pkg/controller/handler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -894,4 +894,24 @@ func TestPropellerHandler_OffloadedWorkflowClosure(t *testing.T) {
err := p.Handle(ctx, namespace, name)
assert.Error(t, err)
})

t.Run("TryMutate failure is handled", func(t *testing.T) {
scope := promutils.NewTestScope()

protoStore := &storagemocks.ComposedProtobufStore{}
protoStore.OnReadProtobufMatch(mock.Anything, mock.Anything, mock.Anything).Return(fmt.Errorf("foo"))
exec.HandleCb = func(ctx context.Context, w *v1alpha1.FlyteWorkflow) error {
return fmt.Errorf("foo")
}
dataStore := storage.NewCompositeDataStore(storage.URLPathConstructor{}, protoStore)
p := NewPropellerHandler(ctx, cfg, dataStore, s, exec, scope)

err := p.Handle(ctx, namespace, name)
assert.Error(t, err, "foo")

r, err := s.Get(ctx, namespace, name)
assert.Nil(t, r.WorkflowSpec)
assert.Nil(t, r.SubWorkflows)
assert.Nil(t, r.Tasks)
})
}

0 comments on commit 7813240

Please sign in to comment.