mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 06:38:20 +00:00
Improve stability of a &expire_func btest
The order in which &expire_func's get called isn't well-defined, so separate the output from either to ensure diffs against the Baseline are always consistent.
This commit is contained in:
parent
9754c2c09f
commit
a3b1d202a5
5 changed files with 21 additions and 14 deletions
4
CHANGES
4
CHANGES
|
@ -1,4 +1,8 @@
|
||||||
|
|
||||||
|
3.1.0-dev.598 | 2020-02-07 15:06:56 -0800
|
||||||
|
|
||||||
|
* Improve stability of a &expire_func btest (Jon Siwek, Corelight)
|
||||||
|
|
||||||
3.1.0-dev.597 | 2020-02-07 15:25:56 -0700
|
3.1.0-dev.597 | 2020-02-07 15:25:56 -0700
|
||||||
|
|
||||||
* plugin/Manager: migrate to std::string_view (Max Kellermann)
|
* plugin/Manager: migrate to std::string_view (Max Kellermann)
|
||||||
|
|
2
VERSION
2
VERSION
|
@ -1 +1 @@
|
||||||
3.1.0-dev.597
|
3.1.0-dev.598
|
||||||
|
|
|
@ -1,20 +1,11 @@
|
||||||
starting: ashish, 1
|
starting: ashish, 1
|
||||||
starting: ashish, 1
|
starting: ashish, 1
|
||||||
inside table_expire_func: ashish, 2
|
inside table_expire_func: ashish, 2
|
||||||
inside table_expire_func: [ashish, ashish], 2
|
|
||||||
inside table_expire_func: ashish, 3
|
inside table_expire_func: ashish, 3
|
||||||
inside table_expire_func: [ashish, ashish], 3
|
|
||||||
inside table_expire_func: ashish, 4
|
inside table_expire_func: ashish, 4
|
||||||
inside table_expire_func: [ashish, ashish], 4
|
|
||||||
inside table_expire_func: ashish, 5
|
inside table_expire_func: ashish, 5
|
||||||
inside table_expire_func: [ashish, ashish], 5
|
|
||||||
inside table_expire_func: ashish, 6
|
inside table_expire_func: ashish, 6
|
||||||
inside table_expire_func: [ashish, ashish], 6
|
|
||||||
inside table_expire_func: ashish, 7
|
inside table_expire_func: ashish, 7
|
||||||
inside table_expire_func: [ashish, ashish], 7
|
|
||||||
inside table_expire_func: ashish, 8
|
inside table_expire_func: ashish, 8
|
||||||
inside table_expire_func: [ashish, ashish], 8
|
|
||||||
inside table_expire_func: ashish, 9
|
inside table_expire_func: ashish, 9
|
||||||
inside table_expire_func: [ashish, ashish], 9
|
|
||||||
inside table_expire_func: ashish, 10
|
inside table_expire_func: ashish, 10
|
||||||
inside table_expire_func: [ashish, ashish], 10
|
|
||||||
|
|
9
testing/btest/Baseline/language.expire_func_mod/out2
Normal file
9
testing/btest/Baseline/language.expire_func_mod/out2
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
inside table_expire_func: [ashish, ashish], 2
|
||||||
|
inside table_expire_func: [ashish, ashish], 3
|
||||||
|
inside table_expire_func: [ashish, ashish], 4
|
||||||
|
inside table_expire_func: [ashish, ashish], 5
|
||||||
|
inside table_expire_func: [ashish, ashish], 6
|
||||||
|
inside table_expire_func: [ashish, ashish], 7
|
||||||
|
inside table_expire_func: [ashish, ashish], 8
|
||||||
|
inside table_expire_func: [ashish, ashish], 9
|
||||||
|
inside table_expire_func: [ashish, ashish], 10
|
|
@ -1,11 +1,14 @@
|
||||||
# @TEST-EXEC: zeek -b %INPUT >out
|
# @TEST-EXEC: zeek -b %INPUT >out
|
||||||
# @TEST-EXEC: btest-diff out
|
# @TEST-EXEC: btest-diff out
|
||||||
|
# @TEST-EXEC: btest-diff out2
|
||||||
|
|
||||||
module Test;
|
module Test;
|
||||||
|
|
||||||
redef exit_only_after_terminate = T;
|
redef exit_only_after_terminate = T;
|
||||||
redef table_expire_interval = .1 secs ;
|
redef table_expire_interval = .1 secs ;
|
||||||
|
|
||||||
|
global out2 = open("out2");
|
||||||
|
|
||||||
export {
|
export {
|
||||||
global table_expire_func: function(t: table[string] of count,
|
global table_expire_func: function(t: table[string] of count,
|
||||||
s: string): interval;
|
s: string): interval;
|
||||||
|
@ -49,10 +52,10 @@ function table_expire_func(t: table[string] of count, s: string): interval
|
||||||
function table_expire_func2 (tt: table[string, string, string] of count, s: string, s2: string, s3: string): interval
|
function table_expire_func2 (tt: table[string, string, string] of count, s: string, s2: string, s3: string): interval
|
||||||
{
|
{
|
||||||
tt[s, s2, s3] += 1;
|
tt[s, s2, s3] += 1;
|
||||||
|
|
||||||
print fmt("inside table_expire_func: [%s, %s], %s", s, s2, tt[s, s2, s3]);
|
|
||||||
|
|
||||||
if ( tt[s, s2, s3] < 10 )
|
print out2, fmt("inside table_expire_func: [%s, %s], %s", s, s2, tt[s, s2, s3]);
|
||||||
|
|
||||||
|
if ( tt[s, s2, s3] < 10 )
|
||||||
return .1 secs ;
|
return .1 secs ;
|
||||||
|
|
||||||
schedule .1sec { die() };
|
schedule .1sec { die() };
|
||||||
|
@ -66,4 +69,4 @@ event zeek_init()
|
||||||
tt[s, s, s] = 1;
|
tt[s, s, s] = 1;
|
||||||
print fmt("starting: %s, %s", s, t[s]);
|
print fmt("starting: %s, %s", s, t[s]);
|
||||||
print fmt("starting: %s, %s", s, tt[s, s, s]);
|
print fmt("starting: %s, %s", s, tt[s, s, s]);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue