Skip to content

Commit 47dfb11

Browse files
tls/test: Updated test_reload_certificates
Now handling situations where the get() call doesn't throw but does return an empty buffer indicating EOF. Signed-off-by: Michael Boquard <[email protected]>
1 parent 8a9e09d commit 47dfb11

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

tests/unit/tls_test.cc

+12-4
Original file line numberDiff line numberDiff line change
@@ -1069,8 +1069,12 @@ SEASTAR_THREAD_TEST_CASE(test_reload_certificates) {
10691069
}
10701070

10711071
try {
1072-
f2.get();
1073-
BOOST_FAIL("should not reach");
1072+
auto res = f2.get();
1073+
// If the server completes sending data to the client
1074+
// during the handshake before the client has fully
1075+
// closed its connection, then the get() call will
1076+
// succeed by return an empty buffer indicating EOF
1077+
BOOST_REQUIRE(res.size() == 0);
10741078
} catch (...) {
10751079
// ok
10761080
}
@@ -1832,8 +1836,12 @@ SEASTAR_THREAD_TEST_CASE(test_reload_certificates_with_only_shard0_notify) {
18321836
}
18331837

18341838
try {
1835-
f2.get();
1836-
BOOST_FAIL("should not reach");
1839+
auto res = f2.get();
1840+
// If the server completes sending data to the client
1841+
// during the handshake before the client has fully
1842+
// closed its connection, then the get() call will
1843+
// succeed by return an empty buffer indicating EOF
1844+
BOOST_REQUIRE(res.size() == 0);
18371845
} catch (...) {
18381846
// ok
18391847
}

0 commit comments

Comments
 (0)