]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Convert test_bio_ssl to use fake time
authorNeil Horman <nhorman@openssl.org>
Fri, 21 Feb 2025 17:22:17 +0000 (12:22 -0500)
committerTomas Mraz <tomas@openssl.org>
Tue, 25 Feb 2025 14:34:24 +0000 (15:34 +0100)
The test_bio_ssl test in quicapitest is failing on windows.  Something
about the timing there is causing wide variance in how long it takes to
establish a handshake (between 130-6500 iterations).

Convert it to use fake time to make it run consistently.

Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26801)

test/quicapitest.c

index dee8f2f6c856c0bf90be2bd888ea7448f2ca4430..1e946877029a149b9da2ad7d8a44ab41806309ab 100644 (file)
@@ -1005,8 +1005,8 @@ static int test_bio_ssl(void)
         goto err;
 
     if (!TEST_true(qtest_create_quic_objects(libctx, NULL, NULL, cert, privkey,
-                                             0, &qtserv, &clientquic, NULL,
-                                             NULL)))
+                                             QTEST_FLAG_FAKE_TIME, &qtserv,
+                                             &clientquic, NULL, NULL)))
         goto err;
 
     msglen = strlen(msg);
@@ -1031,6 +1031,7 @@ static int test_bio_ssl(void)
 
         if (!servererr && rets <= 0) {
             ossl_quic_tserver_tick(qtserv);
+            qtest_add_time(100);
             servererr = ossl_quic_tserver_is_term_any(qtserv);
             if (!servererr)
                 rets = ossl_quic_tserver_is_handshake_confirmed(qtserv);