Skip to content

Commit

Permalink
Debugging in ci
Browse files Browse the repository at this point in the history
  • Loading branch information
emizzle committed Oct 25, 2024
1 parent 6bfea67 commit b6241e6
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tests/codex/utils/testasyncstatemachine.nim
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ method run(state: State1, machine: Machine): Future[?State] {.async.} =

method run(state: State2, machine: Machine): Future[?State] {.async.} =
inc runs[1]
echo "State2 run, runs: ", $runs
try:
await sleepAsync(1.hours)
except CancelledError:
Expand All @@ -36,6 +37,7 @@ method run(state: State3, machine: Machine): Future[?State] {.async.} =

method run(state: State4, machine: Machine): Future[?State] {.async.} =
inc runs[3]
echo "State4 run, runs: ", $runs
raise newException(ValueError, "failed")

method onMoveToNextStateEvent*(state: State): ?State {.base, upraises:[].} =
Expand All @@ -58,6 +60,7 @@ method onError(state: State3, error: ref CatchableError): ?State =

method onError(state: State4, error: ref CatchableError): ?State =
inc errors[3]
echo "State4 onError, errors: ", $errors
some State(State2.new())

asyncchecksuite "async state machines":
Expand Down

0 comments on commit b6241e6

Please sign in to comment.