MCPcopy
hub / github.com/uber-go/zap / TestSleep

Function TestSleep

zaptest/timeout_test.go:36–43  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

34}
35
36func TestSleep(t *testing.T) {
37 defer ztest.Initialize("2")()
38 const sleepFor = 50 * time.Millisecond
39 now := time.Now()
40 Sleep(sleepFor)
41 elapsed := time.Since(now)
42 assert.True(t, 2*sleepFor <= elapsed, "Expected to scale up timeout.")
43}

Callers

nothing calls this directly

Calls 3

InitializeFunction · 0.92
SleepFunction · 0.70
NowMethod · 0.65

Tested by

no test coverage detected