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

Function TestItem_Increase

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

Source from the content-addressed store, hash-verified

14)
15
16func TestItem_Increase(t *testing.T) {
17 if !testutils.IsSingleTesting() {
18 return
19 }
20
21 var item = counters.NewItem[uint32](10)
22 t.Log(item.Increase(), item.Sum())
23 time.Sleep(1 * time.Second)
24 t.Log(item.Increase(), item.Sum())
25 time.Sleep(2 * time.Second)
26 t.Log(item.Increase(), item.Sum())
27 time.Sleep(5 * time.Second)
28 t.Log(item.Increase(), item.Sum())
29 time.Sleep(6 * time.Second)
30 t.Log(item.Increase(), item.Sum())
31 time.Sleep(5 * time.Second)
32 t.Log(item.Increase(), item.Sum())
33 time.Sleep(11 * time.Second)
34 t.Log(item.Increase(), item.Sum())
35}
36
37func TestItem_Increase2(t *testing.T) {
38 // run only under single testing

Callers

nothing calls this directly

Calls 4

IsSingleTestingFunction · 0.92
LogMethod · 0.80
IncreaseMethod · 0.45
SumMethod · 0.45

Tested by

no test coverage detected