test: adjust test-push-race.t timeout's to overall test timeout stable
authorPierre-Yves David <pierre-yves.david@octobus.net>
Thu, 24 Nov 2022 10:34:34 +0100
branchstable
changeset 49656 c6f0bcb7bc57
parent 49647 c217d94cdd9d
child 49664 f56873a7284c
child 49665 ecfc84b956a8
test: adjust test-push-race.t timeout's to overall test timeout The generic `tests/testlib/wait-on-file` mechanism scale its timeout with the value of `HGTEST_TIMEOUT`, the `delaypush.py` in `test-push-race.t` is not doing this, and we have been seeing more and more timeout from loaded CI worker lately. Adding this timeout scaling should help with that.
tests/test-push-race.t
--- a/tests/test-push-race.t	Wed Nov 23 14:42:11 2022 +0100
+++ b/tests/test-push-race.t	Thu Nov 24 10:34:34 2022 +0100
@@ -48,6 +48,14 @@
   >     if watchpath is not None:
   >         ui.status(b'waiting on: %s\n' % watchpath)
   >         limit = 100
+  >         test_default_timeout = os.environ.get('HGTEST_TIMEOUT_DEFAULT')
+  >         test_timeout = os.environ.get('HGTEST_TIMEOUT')
+  >         if (
+  >             test_default_timeout is not None
+  >             and test_timeout is not None
+  >             and test_default_timeout < test_timeout
+  >         ):
+  >             limit = int(limit * (test_timeout / test_default_timeout))
   >         while 0 < limit and not os.path.exists(watchpath):
   >             limit -= 1
   >             time.sleep(0.1)