diff --git a/testing/btest/Baseline/core.recursive-event/output b/testing/btest/Baseline/core.recursive-event/output index 8feeb4e0a5..5ce335085a 100644 --- a/testing/btest/Baseline/core.recursive-event/output +++ b/testing/btest/Baseline/core.recursive-event/output @@ -1,2 +1,22 @@ ### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63. -10 +XXXXXXXXXX.XXXXXX 0 1 +XXXXXXXXXX.XXXXXX 1 2 +XXXXXXXXXX.XXXXXX 0 3 +XXXXXXXXXX.XXXXXX 1 4 +XXXXXXXXXX.XXXXXX 0 5 +XXXXXXXXXX.XXXXXX 1 6 +XXXXXXXXXX.XXXXXX 0 7 +XXXXXXXXXX.XXXXXX 1 8 +XXXXXXXXXX.XXXXXX 0 9 +XXXXXXXXXX.XXXXXX 1 10 +XXXXXXXXXX.XXXXXX 0 11 +XXXXXXXXXX.XXXXXX 1 12 +XXXXXXXXXX.XXXXXX 0 13 +XXXXXXXXXX.XXXXXX 1 14 +XXXXXXXXXX.XXXXXX 0 15 +XXXXXXXXXX.XXXXXX 1 16 +XXXXXXXXXX.XXXXXX 0 17 +XXXXXXXXXX.XXXXXX 1 18 +XXXXXXXXXX.XXXXXX 0 19 +XXXXXXXXXX.XXXXXX 1 20 +unique_nt 11 diff --git a/testing/btest/core/recursive-event.zeek b/testing/btest/core/recursive-event.zeek index fc99638798..3583b369f6 100644 --- a/testing/btest/core/recursive-event.zeek +++ b/testing/btest/core/recursive-event.zeek @@ -1,32 +1,38 @@ -# @TEST-EXEC: zeek -b %INPUT 2>&1 | grep -v termination | sort | uniq | wc -l | awk '{print $1}' >output +# @TEST-EXEC: zeek -b %INPUT >output # @TEST-EXEC: btest-diff output # In old version, the event would keep triggering endlessly, with the network # time not moving forward and Zeek not terminating. -# -# Note that the output will not be 20 because we still execute two rounds -# of events every time we drain and also at startup several (currently 3) -# rounds of events drain with the same network_time. redef exit_only_after_terminate=T; global c = 0; +global last_nt = 0.0; +global unique_nt: set[double]; event test() { c += 1; + local nt = time_to_double(network_time()); + if ( last_nt == 0.0 ) + last_nt = nt; - if ( c == 20 ) + add unique_nt[nt]; + + print fmt("%.5f %d %d", nt, nt != last_nt, c); + last_nt = nt; + + if ( c == 20 ) { + print fmt("unique_nt %d", |unique_nt|); terminate(); return; } - - print network_time(); - event test(); - } + + event test(); + } event zeek_init() - { - event test(); - } + { + event test(); + }