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

Function TestRequestInfo

pkg/controller/rtctrl/request_test.go:26–43  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

24)
25
26func TestRequestInfo(t *testing.T) {
27 rtParams := &NewRuntimeParameters{
28 RuntimeID: "bb",
29 ConcurrentMode: false,
30 StreamMode: false,
31 WaitRuntimeAliveTimeout: 3,
32 Resource: &api.Resource{},
33 }
34 rt := NewRuntimeInfo(rtParams)
35 req := NewRequestInfo("aa", rt)
36 req.SetInitTime(1, 2)
37 if req.InitStartTimeMS != 1 ||
38 req.InitDoneTimeMS != 2 {
39 t.Errorf("init time error: [%d-%d]", req.InitStartTimeMS, req.InitDoneTimeMS)
40 }
41
42 req.InvokeResult(StatusSuccess, "result")
43}
44
45func TestInvokeDone(t *testing.T) {
46 rtParams := &NewRuntimeParameters{

Callers

nothing calls this directly

Calls 5

SetInitTimeMethod · 0.95
InvokeResultMethod · 0.95
NewRuntimeInfoFunction · 0.85
NewRequestInfoFunction · 0.85
ErrorfMethod · 0.80

Tested by

no test coverage detected