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

test_can_bundle_configured_catalogs fails with specific seed #6928

Open
hannes-ucsc opened this issue Feb 25, 2025 · 1 comment
Open

test_can_bundle_configured_catalogs fails with specific seed #6928

hannes-ucsc opened this issue Feb 25, 2025 · 1 comment
Assignees
Labels
orange [process] Done by the Azul team spike:1 [process] Spike estimate of one point test [subject] Unit and integration test code

Comments

@hannes-ucsc
Copy link
Member

hannes-ucsc commented Feb 25, 2025

With this patch …

Subject: [PATCH] WIP
---
Index: test/integration_test.py
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/integration_test.py b/test/integration_test.py
--- a/test/integration_test.py	(revision 3f8d8d9fb3441bbbfb05fa766ec8d97e82b8b59c)
+++ b/test/integration_test.py	(date 1740503707311)
@@ -236,7 +236,7 @@
         super().setUp()
         # All random operations should be made using this seed so that test
         # results are deterministically reproducible
-        self.random_seed = randint(0, sys.maxsize)
+        self.random_seed = 6071700547648562554 # randint(0, sys.maxsize)
         self.random = Random(self.random_seed)
         log.info('Using random seed %r', self.random_seed)
 

… the test fails with …

SubTest failure: Traceback (most recent call last):
  File "/Users/hannes/.pyenv/versions/3.12.8/lib/python3.12/unittest/case.py", line 58, in testPartExecutor
    yield
  File "/Users/hannes/.pyenv/versions/3.12.8/lib/python3.12/unittest/case.py", line 539, in subTest
    yield
  File "/Users/hannes/workspace/hca/azul.hannes2.local/test/integration_test.py", line 1841, in test_can_bundle_configured_catalogs
    self._test_catalog(catalog)
  File "/Users/hannes/workspace/hca/azul.hannes2.local/test/integration_test.py", line 1832, in _test_catalog
    self.assertEqual([], links)
  File "/Users/hannes/Applications/PyCharm Professional Edition.app/Contents/plugins/python-ce/helpers/pycharm/teamcity/diff_tools.py", line 33, in _patched_equals
    old(self, first, second, msg)
AssertionError: Lists differ: [] != [{'inputs': ['anvil_dataset/677dd55c-3fa3-[54 chars] []}]

Second list contains 1 additional elements.
First extra element 0:
{'inputs': ['anvil_dataset/677dd55c-3fa3-4b07-8c98-985d94d7577e'], 'activity': None, 'outputs': []}

- []
+ [{'activity': None,
+   'inputs': ['anvil_dataset/677dd55c-3fa3-4b07-8c98-985d94d7577e'],
+   'outputs': []}]

… in my anvilbox-based personal deployment.

The test was run with develop checked out (3f8d8d9) but that commit wasn't deployed, some other branch (ahead of develop) was. I don't think the deployment is involved in this test so it shouldn't matter, but assignee should first attempt to reproduce.

The purpose of the conditional if len(entities) > 1 isn't immediately obvious to me and should be explained in a comment. I also suspect that the case len(entities) == 1 and potentially even len(entities) == 0 need more assertions. For example, what is that singleton entity? In fact , those assertions might even eliminate the need for an explanatory comment.

@hannes-ucsc hannes-ucsc added the orange [process] Done by the Azul team label Feb 25, 2025
@dsotirho-ucsc dsotirho-ucsc added test [subject] Unit and integration test code spike:1 [process] Spike estimate of one point labels Feb 25, 2025
@dsotirho-ucsc
Copy link
Contributor

Spike to reproduce

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
orange [process] Done by the Azul team spike:1 [process] Spike estimate of one point test [subject] Unit and integration test code
Projects
None yet
Development

No branches or pull requests

3 participants