From b4467fb2299b5439e66be109db1f3c1af0d247f0 Mon Sep 17 00:00:00 2001 From: Karol Nowacki Date: Tue, 5 May 2026 11:39:43 +0000 Subject: [PATCH 1/2] vector_search: test: fix flaky test_dns_resolving_repeated Move trigger_dns_resolver() inside the repeat_until loop instead of calling it once before the loop. The test was intermittently timing out on CI. The exact root cause is not fully understood, but the hypothesis is that a single trigger signal can be lost somewhere (not exactly known where). This is not an issue for the production code because refresh trigger will be called multiple times - in every query where all configured nodes will be unreachable. By triggering inside the loop, we ensure the signal is re-sent on each iteration until the resolver actually performs the refresh and picks up the new (failing) DNS resolution. This makes the test resilient to timing-dependent signal loss without changing production code. Fixes: SCYLLADB-1794 (cherry picked from commit 4722be12895fa111b3c67cdcb6d0be08225ffabb) --- test/vector_search/vector_store_client_test.cc | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/test/vector_search/vector_store_client_test.cc b/test/vector_search/vector_store_client_test.cc index 83e21f43fe..6e95a832a9 100644 --- a/test/vector_search/vector_store_client_test.cc +++ b/test/vector_search/vector_store_client_test.cc @@ -193,12 +193,11 @@ SEASTAR_TEST_CASE(vector_store_client_test_dns_resolving_repeated) { BOOST_CHECK_EQUAL(print_addr(addrs1[0]), "127.0.0.1"); fail_dns_resolution = true; - // Trigger DNS resolver to check for address changes - // Resolver will not re-check automatically after successful resolution - vector_store_client_tester::trigger_dns_resolver(vs); - // Wait for the DNS resolution to fail again + // Wait for the DNS resolution to fail again. + // Trigger is called inside the loop to mitigate SCYLLADB-1794. BOOST_CHECK(co_await repeat_until(seconds(1), [&vs, &as]() -> future { + vector_store_client_tester::trigger_dns_resolver(vs); auto addrs = co_await vector_store_client_tester::resolve_hostname(vs, as.reset()); co_return addrs.empty(); })); From 9ed728a5b37f92102822d6b0d38801f45010320a Mon Sep 17 00:00:00 2001 From: Karol Nowacki Date: Tue, 5 May 2026 17:22:24 +0200 Subject: [PATCH 2/2] vector_search: test: default timeout in test_dns_resolving_repeated Replace explicit 1-second timeouts in repeat_until() with the default STANDARD_WAIT (10s). The 1-second timeout could be too aggressive for loaded CI environments where lowres_clock granularity (~10ms) combined with OS scheduling delays and resource contention (-c2 -m2G) could cause the loop to expire before the DNS refresh task completes its cycle. This also unifies test timeouts across test cases. (cherry picked from commit 207de967fbd58279b4001f00b35c6cc97ec3d27b) --- test/vector_search/vector_store_client_test.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/vector_search/vector_store_client_test.cc b/test/vector_search/vector_store_client_test.cc index 6e95a832a9..876d9bde9d 100644 --- a/test/vector_search/vector_store_client_test.cc +++ b/test/vector_search/vector_store_client_test.cc @@ -176,7 +176,7 @@ SEASTAR_TEST_CASE(vector_store_client_test_dns_resolving_repeated) { vs.start_background_tasks(); // Wait for the DNS resolution to fail - BOOST_CHECK(co_await repeat_until(seconds(1), [&vs, &as]() -> future { + BOOST_CHECK(co_await repeat_until([&vs, &as]() -> future { auto addrs = co_await vector_store_client_tester::resolve_hostname(vs, as.reset()); co_return addrs.empty(); })); @@ -184,7 +184,7 @@ SEASTAR_TEST_CASE(vector_store_client_test_dns_resolving_repeated) { fail_dns_resolution = false; // Wait for the DNS resolution to succeed - BOOST_CHECK(co_await repeat_until(seconds(1), [&vs, &as]() -> future { + BOOST_CHECK(co_await repeat_until([&vs, &as]() -> future { auto addrs = co_await vector_store_client_tester::resolve_hostname(vs, as.reset()); co_return addrs.size() == 1; })); @@ -196,7 +196,7 @@ SEASTAR_TEST_CASE(vector_store_client_test_dns_resolving_repeated) { // Wait for the DNS resolution to fail again. // Trigger is called inside the loop to mitigate SCYLLADB-1794. - BOOST_CHECK(co_await repeat_until(seconds(1), [&vs, &as]() -> future { + BOOST_CHECK(co_await repeat_until([&vs, &as]() -> future { vector_store_client_tester::trigger_dns_resolver(vs); auto addrs = co_await vector_store_client_tester::resolve_hostname(vs, as.reset()); co_return addrs.empty(); @@ -207,7 +207,7 @@ SEASTAR_TEST_CASE(vector_store_client_test_dns_resolving_repeated) { fail_dns_resolution = false; // Wait for the DNS resolution to succeed - BOOST_CHECK(co_await repeat_until(seconds(1), [&vs, &as]() -> future { + BOOST_CHECK(co_await repeat_until([&vs, &as]() -> future { auto addrs = co_await vector_store_client_tester::resolve_hostname(vs, as.reset()); co_return addrs.size() == 1; }));