mirror of
https://github.com/scylladb/scylladb.git
synced 2026-05-21 23:32:15 +00:00
test_unfinished_writes_during_shutdown: await add_last_node_task instead of cancelling it
asyncio cancel() only affects the client-side coroutine. The server-side addserver handler in the cluster manager continues running. If it can't complete (e.g. no raft quorum because the target node is shut down), the orphaned handler blocks _after_test cleanup for 120s. Await the task instead so it completes cleanly (we restart the target node first to restore quorum).
This commit is contained in:
@@ -116,5 +116,5 @@ async def test_unfinished_writes_during_shutdown(request: pytest.FixtureRequest,
|
||||
await manager.server_stop(target_server.server_id)
|
||||
pytest.fail("Shutdown did not complete within 15s — deadlock reproduced")
|
||||
|
||||
logger.info("Cancelling addnode task")
|
||||
add_last_node_task.cancel()
|
||||
logger.info("Waiting for addnode to complete")
|
||||
await add_last_node_task
|
||||
|
||||
Reference in New Issue
Block a user