]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
test_16: adjust timing expectations
authorStefan Eissing <stefan@eissing.org>
Fri, 17 Oct 2025 09:48:35 +0000 (11:48 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Fri, 17 Oct 2025 11:35:35 +0000 (13:35 +0200)
In MOST protocols and runs, the 'pretransfer' time is less than the
'starttransfer'. E.g. request being sent before response comes in.

However, when curl is starved of cpu a server response might start
streaming in before the multi-state transitioned to DID (and recorded
the 'pretransfer' time).

Do no longer check that 'pretransfer' is less or equal 'starttransfer'.
Check that is is less or equal to the total time instead.

Closes #19096

tests/http/test_16_info.py

index ac4f4cc86605298a60e6754831d3acf8cae040bf..53e335e950acb7e4bde9787569472782b41fe0e9 100644 (file)
@@ -160,9 +160,12 @@ class TestInfo:
         for key in ['time_appconnect', 'time_connect', 'time_namelookup']:
             assert s[key] < s['time_pretransfer'], f'time "{key}" larger than' \
                 f'"time_pretransfer": {s}'
-        # assert transfer start is after pretransfer
-        assert s['time_pretransfer'] <= s['time_starttransfer'], f'"time_pretransfer" '\
-            f'greater than "time_starttransfer", {s}'
+        # assert transfer total is after pretransfer.
+        # (in MOST situations, pretransfer is before starttransfer, BUT
+        # in protocols like HTTP we might get a server response already before
+        # we transition to multi state DID.)
+        assert s['time_pretransfer'] <= s['time_total'], f'"time_pretransfer" '\
+            f'greater than "time_total", {s}'
         # assert that transfer start is before total
         assert s['time_starttransfer'] <= s['time_total'], f'"time_starttransfer" '\
             f'greater than "time_total", {s}'