Skip to content

Commit

Permalink
Shore container time in test conftest
Browse files Browse the repository at this point in the history
  • Loading branch information
unkcpz committed Nov 4, 2023
1 parent 291de7d commit 42cc88b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
8 changes: 5 additions & 3 deletions .docker/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,11 @@ def docker_compose(docker_services):
return docker_services._docker_compose


@pytest.fixture
def timeout():
"""Container and service startup timeout"""
@pytest.fixture(scope='session', autouse=True)
def _services_prepare_timeout():
"""Container and service startup timeout, before tests session starts
waiting for the containers to be ready.
"""
return 30


Expand Down
7 changes: 2 additions & 5 deletions .docker/tests/test_aiida.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# -*- coding: utf-8 -*-
# pylint: disable=missing-docstring
import json
import time

from packaging.version import parse
import pytest
Expand All @@ -22,8 +21,7 @@ def test_correct_pgsql_version_installed(aiida_exec, pgsql_version, variant):
assert parse(info['version']).major == parse(pgsql_version).major


def test_verdi_status(aiida_exec, container_user, timeout):
time.sleep(timeout)
def test_verdi_status(aiida_exec, container_user):
output = aiida_exec('verdi status', user=container_user).decode().strip()
assert 'Connected to RabbitMQ' in output
assert 'Daemon is running' in output
Expand All @@ -32,8 +30,7 @@ def test_verdi_status(aiida_exec, container_user, timeout):
assert 'Warning' not in output


def test_computer_setup_success(aiida_exec, container_user, timeout):
time.sleep(timeout)
def test_computer_setup_success(aiida_exec, container_user):
output = aiida_exec('verdi computer test localhost', user=container_user).decode().strip()

assert 'Success' in output
Expand Down

0 comments on commit 42cc88b

Please sign in to comment.