Skip to content

debusine.server.tests.test_consumers tests are flaky (<asyncio.locks.Lock object at 0xxxxxxxxxxxxx [locked]> is bound to a different event loop)

The following tests are failing frequently and intermittently:

  • debusine.server.tests.test_consumers.WorkRequestCompletedConsumerTests.test_work_request_completed_selected_workspace
  • debusine.server.tests.test_consumers.WorkRequestCompletedConsumerTests.test_work_request_completed_workspace_not_monitored
  • debusine.server.tests.test_consumers.WorkerConsumerTransactionTests.test_disconnect_leaves_work_request_as_running
  • debusine.server.tests.test_consumers.WorkerConsumerTransactionTests.test_request_dynamic_metadata_after_connect
  • debusine.server.tests.test_consumers.WorkerConsumerTransactionTests.test_work_request_assigned
  • debusine.server.tests.test_consumers.WorkerConsumerTransactionTests.test_worker_disabled

With the same error:

RuntimeError: <asyncio.locks.Lock object at 0x7f8b5240e250 [locked]> is bound to a different event loop

test_work_request_completed_selected_workspace and test_work_request_completed_workspace_not_monitored seem to be the root and cause the rest of the tests to fail similarly.

This looks like a testing-only error, because it happens when shutting down all the asyncio stack, and restarting it again for the next test. Non-test reports welcome.

Recap 2024-02:

Sample failures:

Edited by Sylvain Beucler
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information