MCPcopy Create free account
hub / github.com/baidu/EasyFaaS / TestRuntimeMap

Function TestRuntimeMap

pkg/controller/rtctrl/runtimeinfo_test.go:27–54  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

25)
26
27func TestRuntimeMap(t *testing.T) {
28 rtMap := NewRuntimeManager(getFuncletNode(), &RuntimeManagerParameters{MaxRuntimeIdle: 10, MaxRunnerDefunct: 30})
29 rtParams := &NewRuntimeParameters{
30 RuntimeID: "aa",
31 ConcurrentMode: false,
32 StreamMode: false,
33 WaitRuntimeAliveTimeout: 3,
34 Resource: &api.Resource{},
35 }
36 rt := rtMap.NewRuntime(rtParams)
37 if rt == nil {
38 t.Error("create runtime aa failed.")
39 }
40 rt2 := rtMap.NewRuntime(rtParams)
41 if rt2 != nil {
42 t.Error("create runtime with same id")
43 }
44
45 rt, err := rtMap.GetRuntime("aa")
46 if err != nil {
47 t.Errorf("invalid runtime with id %s", "aa")
48 }
49 rtlist := rtMap.RuntimeList()
50 if len(rtlist) == 0 {
51 t.Error("runtime list error")
52 }
53 rtMap.DelRuntime("aa")
54}
55
56func TestRuntimeInfo(t *testing.T) {
57 rtParams := &NewRuntimeParameters{

Callers

nothing calls this directly

Calls 8

NewRuntimeMethod · 0.95
GetRuntimeMethod · 0.95
RuntimeListMethod · 0.95
DelRuntimeMethod · 0.95
getFuncletNodeFunction · 0.85
ErrorfMethod · 0.80
NewRuntimeManagerFunction · 0.70
ErrorMethod · 0.45

Tested by

no test coverage detected