summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2023-09-18 17:06:31 +0100
committerMatt Caswell <matt@openssl.org>2023-09-22 13:56:43 +0100
commit5d3933eef0d937a4845a439d5fbfa76738592fc0 (patch)
tree445530365e8e3232fa6e09f7f5fcbc8ebd71976e /test
parenta2026db2643db1e34cc25960e9ef74d08bcdee5a (diff)
Use fake time rather than real time in the noisy dgram test
Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/22157)
Diffstat (limited to 'test')
-rw-r--r--test/quicapitest.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/test/quicapitest.c b/test/quicapitest.c
index 0030c31082..023738a22b 100644
--- a/test/quicapitest.c
+++ b/test/quicapitest.c
@@ -1276,7 +1276,7 @@ static int unreliable_client_read(SSL *clientquic, SSL **stream, void *buf,
return 0;
}
ossl_quic_tserver_tick(qtserv);
- OSSL_sleep(10);
+ qtest_add_time(1);
}
return 0;
@@ -1295,7 +1295,7 @@ static int unreliable_server_read(QUIC_TSERVER *qtserv, uint64_t sid,
return 1;
ossl_quic_tserver_tick(qtserv);
SSL_handle_events(clientquic);
- OSSL_sleep(10);
+ qtest_add_time(1);
}
return 0;
@@ -1315,7 +1315,8 @@ static int test_noisy_dgram(void)
if (!TEST_ptr(cctx)
|| !TEST_true(qtest_create_quic_objects(libctx, cctx, NULL, cert,
privkey,
- QTEST_FLAG_NOISE,
+ QTEST_FLAG_NOISE
+ | QTEST_FLAG_FAKE_TIME,
&qtserv,
&clientquic, NULL)))
goto err;
@@ -1334,6 +1335,7 @@ static int test_noisy_dgram(void)
if (!TEST_true(ossl_quic_tserver_stream_new(qtserv, 0, &sid)))
goto err;
ossl_quic_tserver_tick(qtserv);
+ qtest_add_time(1);
/*
* Send data from the server to the client. Some datagrams may get lost,
@@ -1347,6 +1349,7 @@ static int test_noisy_dgram(void)
|| !TEST_size_t_eq(msglen, written))
goto err;
ossl_quic_tserver_tick(qtserv);
+ qtest_add_time(1);
/*
* Since the underlying BIO is now noisy we may get failures that
@@ -1368,6 +1371,8 @@ static int test_noisy_dgram(void)
goto err;
ossl_quic_tserver_tick(qtserv);
+ qtest_add_time(1);
+
/*
* Since the underlying BIO is now noisy we may get failures that
* need to be retried - so we use unreliable_server_read() to handle