From a9a37c865eb1eaee8a29e48c9ead31443121735c Mon Sep 17 00:00:00 2001 From: Arne Welzel Date: Tue, 18 Apr 2023 15:06:39 +0200 Subject: [PATCH] log-caching-cluster: Wait for X509::known_log_certs to populate The known_log_certs table is populated asynchronously via broker after a Broker::peer_added. It may take a variable amount of time depending on where we run this test and it has been observed flaky specifically for the arm_debian11 task. Instead of racing, give worker-2 3 seconds for receiving the expected table content before continuing. Fixes #2885 --- .../base/files/x509/log-caching-cluster.test | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/testing/btest/scripts/base/files/x509/log-caching-cluster.test b/testing/btest/scripts/base/files/x509/log-caching-cluster.test index 98c4033204..f7a0373f24 100644 --- a/testing/btest/scripts/base/files/x509/log-caching-cluster.test +++ b/testing/btest/scripts/base/files/x509/log-caching-cluster.test @@ -41,7 +41,20 @@ event zeek_init() event Broker::peer_added(endpoint: Broker::EndpointInfo, msg: string) { - continue_processing(); + if ( /worker-2/ in Cluster::node ) + { + when ( |X509::known_log_certs| >= 3 ) + { + continue_processing(); + } + timeout 3sec + { + Reporter::error("Timeout waiting for X509::known_log_certs to be populated!"); + terminate(); + } + } + else + continue_processing(); } @endif