test(backend): share the integration timeout budget between shards
This commit is contained in:
1 parent
d8abaae85b
commit
d6f960f8ae
4 files changed
+26
-3
No files matched your search
@@ -114,6 +114,18 @@ class IntegrationSuiteTests(unittest.TestCase):
|
||||
self.assertEqual(result.returncode, 0, result.stderr)
|
||||
self.assertEqual(len(self.selected(calls)), 5)
|
||||
|
||||
def test_timeout_shares_the_suite_budget_between_shards(self):
|
||||
cases = [(None, "20m"), ("1", "20m"), ("2", "10m"), ("3", "10m")]
|
||||
for total, expected in cases:
|
||||
with self.subTest(total=total):
|
||||
settings = None if total is None else {"TEST_SHARD_INDEX": "1", "TEST_SHARD_TOTAL": total}
|
||||
result, calls = self.run_suite(settings)
|
||||
self.assertEqual(result.returncode, 0, result.stderr)
|
||||
runs = [args for args in calls if any(arg.startswith("-run=") for arg in args)]
|
||||
self.assertTrue(runs)
|
||||
for args in runs:
|
||||
self.assertIn("-timeout=" + expected, args)
|
||||
|
||||
def test_discovery_order_does_not_change_selection(self):
|
||||
settings = {"TEST_SHARD_INDEX": "1", "TEST_SHARD_TOTAL": "2"}
|
||||
result, calls = self.run_suite(settings)
|
||||
|
||||
Reference in new issue
Block a user