@@ -368,8 +368,8 @@ func TestTimeout(t *testing.T) {
368368 "my.input" : "Arachni" ,
369369 }
370370
371- t .Run ("not-empty-metricsStore " , func (t * testing.T ) {
372- context := NewContextWithBudget (waf , time .Millisecond )
371+ t .Run ("not-empty-metrics-match " , func (t * testing.T ) {
372+ context := NewContextWithBudget (waf , time .Hour )
373373 require .NotNil (t , context )
374374 defer context .Close ()
375375
@@ -382,6 +382,20 @@ func TestTimeout(t *testing.T) {
382382 require .NotZero (t , context .Stats ().Timers ["_dd.appsec.waf.duration" ])
383383 })
384384
385+ t .Run ("not-empty-metrics-no-match" , func (t * testing.T ) {
386+ context := NewContextWithBudget (waf , time .Hour )
387+ require .NotNil (t , context )
388+ defer context .Close ()
389+
390+ _ , err := context .Run (RunAddressData {Persistent : map [string ]any {"my.input" : "curl/7.88" }}, 0 )
391+ require .NoError (t , err )
392+ require .NotEmpty (t , context .Stats ())
393+ require .NotZero (t , context .Stats ().Timers ["_dd.appsec.waf.decode" ])
394+ require .NotZero (t , context .Stats ().Timers ["_dd.appsec.waf.encode" ])
395+ require .NotZero (t , context .Stats ().Timers ["_dd.appsec.waf.duration_ext" ])
396+ require .NotZero (t , context .Stats ().Timers ["_dd.appsec.waf.duration" ])
397+ })
398+
385399 t .Run ("timeout-persistent-encoder" , func (t * testing.T ) {
386400 context := NewContextWithBudget (waf , time .Millisecond )
387401 require .NotNil (t , context )
0 commit comments