(num int)
| 54 | } |
| 55 | |
| 56 | func initRuntimeList(num int) *RuntimeManager { |
| 57 | rtMap := NewRuntimeManager(getFuncletNode(), &RuntimeManagerParameters{MaxRuntimeIdle: 10, MaxRunnerDefunct: 30}) |
| 58 | // prepare a runtime list |
| 59 | for i := 0; i < num; i++ { |
| 60 | rtParams := &NewRuntimeParameters{ |
| 61 | RuntimeID: "runtime-" + strconv.Itoa(i), |
| 62 | ConcurrentMode: true, |
| 63 | StreamMode: false, |
| 64 | WaitRuntimeAliveTimeout: 3, |
| 65 | Resource: &api.Resource{ |
| 66 | MilliCPUs: 100, |
| 67 | Memory: 134217728, |
| 68 | }, |
| 69 | } |
| 70 | rt := rtMap.NewRuntime(rtParams) |
| 71 | rt.SetState(RuntimeStateCold) |
| 72 | } |
| 73 | return rtMap |
| 74 | } |
| 75 | |
| 76 | func TestGetRuntime(t *testing.T) { |
| 77 | rtMap := initRuntimeList(1) |
no test coverage detected