Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Race condition in DockerContainerTestCase #6587

Open
achave11-ucsc opened this issue Sep 20, 2024 · 0 comments
Open

Race condition in DockerContainerTestCase #6587

achave11-ucsc opened this issue Sep 20, 2024 · 0 comments
Assignees
Labels
+ [priority] High bug [type] A defect preventing use of the system as specified debt [type] A defect incurring continued engineering cost no demo [process] Not to be demonstrated at the end of the sprint orange [process] Done by the Azul team test [subject] Unit and integration test code

Comments

@achave11-ucsc
Copy link
Member

… causes the transit failure of various unit tests in the unit test suit due to a required docker container not publishing its ports promptly after creation.

The failure may present itself as …

======================================================================
ERROR: setUpClass (indexer.test_tdr.TestTDRHCAPlugin)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/achave11/Pycharm/Azul/azul.sc/.venv/lib/python3.11/site-packages/more_itertools/more.py", line 539, in one
    first_value = next(it)
                  ^^^^^^^^
StopIteration

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/Users/achave11/Pycharm/Azul/azul.sc/test/indexer/test_tdr.py", line 190, in setUpClass
    cls.netloc = cls._create_container(image=image,
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/achave11/Pycharm/Azul/azul.sc/test/docker_container_test_case.py", line 94, in _create_container
    port = one(ports[f'{container_port}/tcp'])
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/achave11/Pycharm/Azul/azul.sc/.venv/lib/python3.11/site-packages/more_itertools/more.py", line 541, in one
    raise (
ValueError: too few items in iterable (expected 1)

----------------------------------------------------------------------
Ran 432 tests in 760.136s

FAILED (errors=1, skipped=3)
make: *** [test] Error 1

… a ValueError failure in any test class that inherits from DockerContainerTestCase. Alternatively, the ValueError is raised with the last call in the tree like super().setUpClass() followed by the ValueError, and completely omitting the one(ports[f'{container_port}/tcp']) part.

@achave11-ucsc achave11-ucsc added orange [process] Done by the Azul team bug [type] A defect preventing use of the system as specified labels Sep 20, 2024
@dsotirho-ucsc dsotirho-ucsc added debt [type] A defect incurring continued engineering cost test [subject] Unit and integration test code + [priority] High labels Sep 23, 2024
@nadove-ucsc nadove-ucsc added the no demo [process] Not to be demonstrated at the end of the sprint label Oct 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
+ [priority] High bug [type] A defect preventing use of the system as specified debt [type] A defect incurring continued engineering cost no demo [process] Not to be demonstrated at the end of the sprint orange [process] Done by the Azul team test [subject] Unit and integration test code
Projects
None yet
Development

No branches or pull requests

3 participants