Mercurial > hg > orthanc-tests
changeset 987:ea4b4ec7eef1
added timeout to avoid infinite loop
| author | Alain Mazy <am@orthanc.team> |
|---|---|
| date | Fri, 25 Sep 2026 16:24:42 +0200 |
| parents | 9ce3f60410b4 |
| children | 99e19529a7e0 |
| files | Tests/Tests.py |
| diffstat | 1 files changed, 5 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/Tests/Tests.py Fri Sep 25 14:31:15 2026 +0200 +++ b/Tests/Tests.py Fri Sep 25 16:24:42 2026 +0200 @@ -6918,13 +6918,15 @@ def test_storage_commitment_store(self): # Storage commitment is available since Orthanc 1.6.0 - def WaitTransaction(uid): - while True: + def WaitTransaction(uid, timeout=5): + retries = 0 + while retries * 0.1 < timeout: s = DoGet(_REMOTE, '/storage-commitment/%s' % uid) if s['Status'] != 'Pending': return s else: - time.sleep(0.01) + time.sleep(0.1) + retries += 1 i = UploadInstance(_REMOTE, 'DummyCT.dcm')['ID'] self.assertEqual(1, len(DoGet(_REMOTE, '/instances')))
