MCPcopy Index your code
hub / github.com/zalando/skipper / TestSleep

Function TestSleep

script/script_test.go:516–530  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

514}
515
516func TestSleep(t *testing.T) {
517 ctx := &testContext{
518 script: `function request(ctx, params) sleep(100.1) end`,
519 }
520 t0 := time.Now()
521 _, err := runFilter(LuaOptions{}, ctx)
522 if err != nil {
523 t.Fatalf("failed to run filter: %v", err)
524 }
525 t1 := time.Now()
526
527 if t1.Sub(t0) < 100*time.Millisecond {
528 t.Error("expected delay of 100 ms")
529 }
530}
531
532// testable example have to refer known identifier
533const LoadFileOK = `testdata/load_ok.lua`

Callers

nothing calls this directly

Calls 3

runFilterFunction · 0.85
SubMethod · 0.80
ErrorMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…