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
This commit is contained in:
Arne Welzel 2023-04-18 15:06:39 +02:00
parent 75245bd365
commit a9a37c865e

View file

@ -41,6 +41,19 @@ event zeek_init()
event Broker::peer_added(endpoint: Broker::EndpointInfo, msg: string)
{
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