MCPcopy Create free account
hub / github.com/GoEdgeLab/EdgeNode / TestItem_IsExpired

Function TestItem_IsExpired

internal/utils/counters/item_test.go:55–68  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

53}
54
55func TestItem_IsExpired(t *testing.T) {
56 if !testutils.IsSingleTesting() {
57 return
58 }
59
60 var item = counters.NewItem[uint32](10)
61 t.Log(item.IsExpired(time.Now().Unix()))
62 time.Sleep(10 * time.Second)
63 t.Log(item.IsExpired(time.Now().Unix()))
64 time.Sleep(2 * time.Second)
65 t.Log(item.IsExpired(time.Now().Unix()))
66 time.Sleep(2 * time.Second)
67 t.Log(item.IsExpired(time.Now().Unix()))
68}
69
70func BenchmarkItem_Increase(b *testing.B) {
71 runtime.GOMAXPROCS(1)

Callers

nothing calls this directly

Calls 4

IsSingleTestingFunction · 0.92
LogMethod · 0.80
UnixMethod · 0.80
IsExpiredMethod · 0.45

Tested by

no test coverage detected