MCPcopy
hub / github.com/fluid-cloudnative/fluid / TestRequeueAfterInterval

Function TestRequeueAfterInterval

pkg/utils/crtl_utils_test.go:26–47  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

24}
25
26func TestRequeueAfterInterval(t *testing.T) {
27 testCases := map[string]string{
28 "test calculate duration case 1": "5m10s",
29 "test calculate duration case 2": "6h7m0s",
30 "test calculate duration case 3": "2h7m2s",
31 }
32
33 for k, item := range testCases {
34 mockDuration, err := time.ParseDuration(item)
35 if err != nil {
36 t.Errorf("%s is not suitable", k)
37 }
38 result, err := RequeueAfterInterval(mockDuration)
39 if err != nil {
40 t.Errorf("err should be nil")
41 }
42 if result.RequeueAfter.String() != item {
43 t.Errorf("%s is wrong, want %s, get %s", k, item, result.RequeueAfter.String())
44 }
45
46 }
47}
48
49func TestRequeueImmediately(t *testing.T) {
50 result, err := RequeueImmediately()

Callers

nothing calls this directly

Calls 2

RequeueAfterIntervalFunction · 0.85
StringMethod · 0.45

Tested by

no test coverage detected