Skip to content

Commit 23155ae

Browse files
authored
test(durable): unblock the merge queue on callback mutants and msgpack (#414)
* test(durable): close the hand-off coroutine when the refusal is missing * chore(deps-dev): bump msgpack to 1.2.4
1 parent b8f3430 commit 23155ae

2 files changed

Lines changed: 95 additions & 86 deletions

File tree

‎src/volcano_sdk/_tests/test_durable_callback_token.py‎

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -274,11 +274,17 @@ def hand_off(token: str) -> Coroutine[object, object, None]:
274274

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

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

283289

284290
class Pending:

0 commit comments

Comments
 (0)