Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions src/volcano_sdk/_tests/test_durable_callback_token.py
Original file line number Diff line number Diff line change
Expand Up @@ -274,11 +274,17 @@ def hand_off(token: str) -> Coroutine[object, object, None]:

submit = token_submitter(API_URL, "arn:execution", "payment", hand_off)

with pytest.raises(TypeError, match=SYNCHRONOUS):
submit("callback-4", None)
# Read the state, then close the coroutine either way: one left unclosed
# when the refusal is missing outlives the test and fails the session.
try:
with pytest.raises(TypeError, match=SYNCHRONOUS):
submit("callback-4", None)
finally:
states = [inspect.getcoroutinestate(coroutine) for coroutine in started]
for coroutine in started:
coroutine.close()
assert handed == []
[coroutine] = started
assert inspect.getcoroutinestate(coroutine) == inspect.CORO_CLOSED
assert states == [inspect.CORO_CLOSED]


class Pending:
Expand Down
Loading
Loading