-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix bug with error state writing #6
Conversation
@@ -716,10 +717,14 @@ func TestProcessor_Serialization(t *testing.T) { | |||
State[MyAppContext, MyOverallContext, MyJobContext]{ | |||
TriggerState: TRIGGER_STATE_NEW, | |||
Exec: func(ctx context.Context, ac MyAppContext, oc MyOverallContext, jc MyJobContext) (MyJobContext, string, []KickRequest[MyJobContext], error) { | |||
if jc.Count == 1 { | |||
return jc, STATE_DONE, nil, errors.New("errored again") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why errors again?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to confirm that if multiple errors are detected, they are recorded separately and don't clobber each other. You can see this assertion lower in the test case
// Execute the job | ||
rtn := Return[JC]{ | ||
PriorState: j.State, | ||
PriorState: priorState, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a test that catches this bug?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The updated test case does
@@ -716,10 +717,14 @@ func TestProcessor_Serialization(t *testing.T) { | |||
State[MyAppContext, MyOverallContext, MyJobContext]{ | |||
TriggerState: TRIGGER_STATE_NEW, | |||
Exec: func(ctx context.Context, ac MyAppContext, oc MyOverallContext, jc MyJobContext) (MyJobContext, string, []KickRequest[MyJobContext], error) { | |||
if jc.Count == 1 { | |||
return jc, STATE_DONE, nil, errors.New("errored again") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Test for this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see it
Errors were not being added to the state file