mirror of
https://github.com/zeek/zeek.git
synced 2025-10-12 11:38:20 +00:00
Improve stability of a unit test
This commit is contained in:
parent
723793aa9e
commit
002109973d
3 changed files with 24 additions and 10 deletions
4
CHANGES
4
CHANGES
|
@ -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
|
2.6-568 | 2019-07-03 11:50:56 -0700
|
||||||
|
|
||||||
* Add clang-tidy rule to CMake including a base configuration (Tim Wojtulewicz, Corelight)
|
* Add clang-tidy rule to CMake including a base configuration (Tim Wojtulewicz, Corelight)
|
||||||
|
|
2
VERSION
2
VERSION
|
@ -1 +1 @@
|
||||||
2.6-568
|
2.6-569
|
||||||
|
|
|
@ -56,7 +56,7 @@ event slow_death()
|
||||||
schedule 2sec { die() };
|
schedule 2sec { die() };
|
||||||
}
|
}
|
||||||
|
|
||||||
event kill_worker()
|
event ready()
|
||||||
{
|
{
|
||||||
Reporter::info("qux");
|
Reporter::info("qux");
|
||||||
Broker::publish("death", slow_death);
|
Broker::publish("death", slow_death);
|
||||||
|
@ -69,20 +69,30 @@ event zeek_init()
|
||||||
Broker::subscribe("death");
|
Broker::subscribe("death");
|
||||||
suspend_processing();
|
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)
|
event Broker::peer_added(endpoint: Broker::EndpointInfo, msg: string)
|
||||||
{
|
{
|
||||||
if ( Cluster::node == "manager-1" )
|
|
||||||
{
|
|
||||||
schedule 2sec { kill_worker() };
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( Cluster::node == "worker-1" )
|
if ( Cluster::node == "worker-1" )
|
||||||
{
|
|
||||||
continue_processing();
|
continue_processing();
|
||||||
Reporter::info("qux");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
event Broker::peer_lost(endpoint: Broker::EndpointInfo, msg: string)
|
event Broker::peer_lost(endpoint: Broker::EndpointInfo, msg: string)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue