kanisterio / kanister

An extensible framework for application-level data management on Kubernetes
https://kanister.io
Apache License 2.0
764 stars 155 forks source link

Fix TestError: Wait for process to terminate #3201

Closed tdmanv closed 3 weeks ago

tdmanv commented 4 weeks ago

Change Overview

Fixes test failure:

[2024-10-22T00:24:22.205Z] === RUN   Test/KanXSuite/TestError
[2024-10-22T00:24:22.205Z]     kanx_test.go:26: Directory:  /tmp/KanXSuite.TestError1241783243
[2024-10-22T00:24:22.205Z] {"File":"pkg/kanx/kanx_test.go","Function":"github.com/kanisterio/kanister/pkg/kanx.(*KanXSuite).TestError.func1","Line":170,"address":{"Name":"/tmp/KanXSuite.TestError1241783243/kanx.sock","Net":"unix"},"hostname":"59ff3afbb586","level":"info","msg":"Listening on socket","time":"2024-10-22T00:10:41.638214724Z"}
[2024-10-22T00:24:22.205Z] {"File":"pkg/kanx/kanx_grpc.pb.go","Function":"github.com/kanisterio/kanister/pkg/kanx._ProcessService_CreateProcesses_Handler","Line":190,"hostname":"59ff3afbb586","level":"info","msg":"pid:54220  state:PROCESS_STATE_RUNNING","pid":54220,"stderr":"/tmp/KanXSuite.TestError1241783243/kando.3462551783.stderr","stdout":"/tmp/KanXSuite.TestError1241783243/kando.3639450115.stdout","time":"2024-10-22T00:10:41.645434307Z"}
[2024-10-22T00:24:22.205Z] {"File":"runtime/asm_amd64.s","Function":"runtime.goexit","Line":1695,"hostname":"59ff3afbb586","level":"info","msg":"pid:54220  state:PROCESS_STATE_FAILED  exitCode:-1  exitErr:\"signal: killed\"","time":"2024-10-22T00:10:41.680401732Z"}
[2024-10-22T00:24:22.205Z]     kanx_test.go:199: 
[2024-10-22T00:24:22.205Z]         error:
[2024-10-22T00:24:22.205Z]           values are not equal
[2024-10-22T00:24:22.205Z]         got:
[2024-10-22T00:24:22.205Z]           s"PROCESS_STATE_RUNNING"
[2024-10-22T00:24:22.205Z]         want:
[2024-10-22T00:24:22.205Z]           s"PROCESS_STATE_FAILED"
[2024-10-22T00:24:22.205Z]         stack:
[2024-10-22T00:24:22.205Z]           /root/go/pkg/mod/github.com/kanisterio/kanister@v0.0.0-20241015163839-d158af1cc013/pkg/kanx/kanx_test.go:199
[2024-10-22T00:24:22.205Z]             c.Assert(ps[0].GetState(), Equals, ProcessState_PROCESS_STATE_FAILED)
[2024-10-22T00:24:22.205Z]           /usr/local/go/src/reflect/value.go:596
[2024-10-22T00:24:22.205Z]             call(frametype, fn, stackArgs, uint32(frametype.Size()), uint32(abid.retOffset), uint32(frameSize), &regArgs)
[2024-10-22T00:24:22.205Z]           /usr/local/go/src/reflect/value.go:380
[2024-10-22T00:24:22.205Z]             return v.call("Call", in)
[2024-10-22T00:24:22.205Z]           /codefresh/volume/k10/go/src/kasten.io/qt-check/suite.go:110
[2024-10-22T00:24:22.205Z]             test.Func.Call([]reflect.Value{reflect.ValueOf(suite), reflect.ValueOf(tc)})

Pull request type

Please check the type of change your PR introduces:

Issues

Test Plan