scitacean.testing.backend.wait_until_backend_is_live#

scitacean.testing.backend.wait_until_backend_is_live(max_time, n_tries)[source]#

Sleep until a connection to the backend can be made.

The backend takes a few seconds to become usable after the docker container was started. This function attempts to connect periodically until the connection succeeds or max_time is reached.

Parameters:
  • max_time (float) – Maximum time in seconds to wait for the backend to become usable.

  • n_tries (int) – Number of connection attempts within max_time.

Raises:

RuntimeError – If no connection can be made within the time limit.

Return type:

None