Improve stability of a unit test

This commit is contained in:
Jon Siwek 2019-07-03 13:03:22 -07:00
parent 723793aa9e
commit 002109973d
3 changed files with 24 additions and 10 deletions

View file

@ -1,4 +1,8 @@
2.6-569 | 2019-07-03 13:03:22 -0700
* Improve stability of a unit test (Jon Siwek, Corelight)
2.6-568 | 2019-07-03 11:50:56 -0700
* Add clang-tidy rule to CMake including a base configuration (Tim Wojtulewicz, Corelight)

View file

@ -1 +1 @@
2.6-568
2.6-569

View file

@ -56,7 +56,7 @@ event slow_death()
schedule 2sec { die() };
}
event kill_worker()
event ready()
{
Reporter::info("qux");
Broker::publish("death", slow_death);
@ -69,20 +69,30 @@ event zeek_init()
Broker::subscribe("death");
suspend_processing();
}
if ( Cluster::node == "manager-1" )
{
Broker::subscribe("ready");
}
}
global conn_count = 0;
event new_connection(c: connection)
{
++conn_count;
if ( conn_count == 30 )
{
Reporter::info("qux");
Broker::publish("ready", ready);
}
}
event Broker::peer_added(endpoint: Broker::EndpointInfo, msg: string)
{
if ( Cluster::node == "manager-1" )
{
schedule 2sec { kill_worker() };
}
if ( Cluster::node == "worker-1" )
{
continue_processing();
Reporter::info("qux");
}
}
event Broker::peer_lost(endpoint: Broker::EndpointInfo, msg: string)