Skip to content

Commit

Permalink
[Keystone] Bugfix: Error comparison; Adjust schedule in sample OCR co…
Browse files Browse the repository at this point in the history
…nfig (#13532)
  • Loading branch information
bolekk authored Jun 12, 2024
1 parent 2db7369 commit e588450
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion core/scripts/keystone/ocr_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"DeltaCertifiedCommitRequestMillis": 1000,
"DeltaStageMillis": 30000,
"MaxRoundsPerEpoch": 10,
"TransmissionSchedule": [4],
"TransmissionSchedule": [7],

"MaxDurationQueryMillis": 1000,
"MaxDurationObservationMillis": 1000,
Expand Down
2 changes: 1 addition & 1 deletion core/services/workflows/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -582,7 +582,7 @@ func (e *Engine) workerForStepRequest(ctx context.Context, msg stepRequest) {
inputs, outputs, err := e.executeStep(ctx, l, msg)
var stepStatus string
switch {
case errors.Is(err, capabilities.ErrStopExecution):
case errors.Is(capabilities.ErrStopExecution, err):
l.Infow("step executed successfully with a termination")
stepStatus = store.StatusCompletedEarlyExit
case err != nil:
Expand Down
3 changes: 2 additions & 1 deletion core/services/workflows/engine_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,8 @@ func mockConsensusWithEarlyTermination() *mockCapability {
),
func(req capabilities.CapabilityRequest) (capabilities.CapabilityResponse, error) {
return capabilities.CapabilityResponse{
Err: capabilities.ErrStopExecution,
// copy error object to make sure message comparison works as expected
Err: errors.New(capabilities.ErrStopExecution.Error()),
}, nil
},
)
Expand Down

0 comments on commit e588450

Please sign in to comment.