Skip to content

Commit

Permalink
fix: handle context cancellations in txsim (backport #2830) (#2833)
Browse files Browse the repository at this point in the history
This is an automatic backport of pull request #2830 done by
[Mergify](https://mergify.com).


---


<details>
<summary>Mergify commands and options</summary>

<br />

More conditions and actions can be found in the
[documentation](https://docs.mergify.com/).

You can also trigger Mergify actions by commenting on this pull request:

- `@Mergifyio refresh` will re-evaluate the rules
- `@Mergifyio rebase` will rebase this PR on its base branch
- `@Mergifyio update` will merge the base branch into this PR
- `@Mergifyio backport <destination>` will backport this PR on
`<destination>` branch

Additionally, on Mergify [dashboard](https://dashboard.mergify.com) you
can:

- look at your merge queues
- generate the Mergify configuration with the config editor.

Finally, you can contact us on https://mergify.com
</details>

Co-authored-by: Callum Waters <[email protected]>
  • Loading branch information
mergify[bot] and cmwaters authored Nov 10, 2023
1 parent 77bf9e8 commit 8e779fa
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions test/txsim/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,16 @@ func Run(
log.Info().Err(err).Msg("sequence terminated")
continue
}
if errors.Is(err, context.Canceled) || errors.Is(err, context.DeadlineExceeded) {
continue
}
log.Error().Err(err).Msg("sequence failed")
finalErr = err
}

if ctx.Err() != nil {
return ctx.Err()
}

return finalErr
}

0 comments on commit 8e779fa

Please sign in to comment.