mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00
Fix the expire-redef.bro test
The expire-redef.bro test was sometimes failing due to the second "Run" message being printed after (should happen before) the "Expired" message. Fixed by increasing the time interval between events. Also reduced the number of events raised to make the test finish more quickly.
This commit is contained in:
parent
bb14765e08
commit
7127800791
2 changed files with 5 additions and 7 deletions
|
@ -1,5 +1,3 @@
|
|||
Run 0
|
||||
Run 1
|
||||
Expired: 0 --> some data
|
||||
Run 2
|
||||
Run 3
|
||||
|
|
|
@ -9,16 +9,16 @@ global expired: function(tbl: table[int] of string, idx: int): interval;
|
|||
global data: table[int] of string &write_expire=exp_val &expire_func=expired;
|
||||
|
||||
redef table_expire_interval = 1sec;
|
||||
redef exp_val = 5sec;
|
||||
redef exp_val = 6sec;
|
||||
|
||||
global runs = 0;
|
||||
event do_it()
|
||||
{
|
||||
++runs;
|
||||
print fmt("Run %s", runs);
|
||||
|
||||
++runs;
|
||||
if ( runs < 4 )
|
||||
schedule 2sec { do_it() };
|
||||
if ( runs < 2 )
|
||||
schedule 4sec { do_it() };
|
||||
else
|
||||
terminate();
|
||||
}
|
||||
|
@ -33,5 +33,5 @@ function expired(tbl: table[int] of string, idx: int): interval
|
|||
event bro_init() &priority=-10
|
||||
{
|
||||
data[0] = "some data";
|
||||
schedule 2sec { do_it() };
|
||||
schedule 4sec { do_it() };
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue