Fix Goroutine Leak of Nomad execute command
that was triggered when [the execution timeout got exceeded, the runner got destroyed, or the WebSocket connection to CodeOcean closed] and the Allocation did not react to the SIGQUIT within the grace period.
This commit is contained in:
@@ -219,12 +219,8 @@ func (s *ExecuteInteractivelyTestSuite) TestSendsSignalAfterTimeout() {
|
||||
}
|
||||
|
||||
func (s *ExecuteInteractivelyTestSuite) TestDestroysRunnerAfterTimeoutAndSignal() {
|
||||
s.T().Skip("ToDo: Refactor NomadJob.executeCommand. Stuck in sending to channel") // ToDo
|
||||
|
||||
ctx, cancel := context.WithCancel(context.Background())
|
||||
defer cancel()
|
||||
s.mockedExecuteCommandCall.Run(func(args mock.Arguments) {
|
||||
<-ctx.Done()
|
||||
<-s.TestCtx.Done()
|
||||
})
|
||||
runnerDestroyed := false
|
||||
s.runner.onDestroy = func(_ Runner) error {
|
||||
@@ -255,10 +251,8 @@ func (s *ExecuteInteractivelyTestSuite) TestResetTimerGetsCalled() {
|
||||
}
|
||||
|
||||
func (s *ExecuteInteractivelyTestSuite) TestExitHasTimeoutErrorIfRunnerTimesOut() {
|
||||
ctx, cancel := context.WithCancel(context.Background())
|
||||
defer cancel()
|
||||
s.mockedExecuteCommandCall.Run(func(args mock.Arguments) {
|
||||
<-ctx.Done()
|
||||
<-s.TestCtx.Done()
|
||||
}).Return(0, nil)
|
||||
s.mockedTimeoutPassedCall.Return(true)
|
||||
executionRequest := &dto.ExecutionRequest{}
|
||||
@@ -274,12 +268,8 @@ func (s *ExecuteInteractivelyTestSuite) TestExitHasTimeoutErrorIfRunnerTimesOut(
|
||||
}
|
||||
|
||||
func (s *ExecuteInteractivelyTestSuite) TestDestroyReasonIsPassedToExecution() {
|
||||
s.T().Skip("See TestDestroysRunnerAfterTimeoutAndSignal")
|
||||
|
||||
ctx, cancel := context.WithCancel(context.Background())
|
||||
defer cancel()
|
||||
s.mockedExecuteCommandCall.Run(func(args mock.Arguments) {
|
||||
<-ctx.Done()
|
||||
<-s.TestCtx.Done()
|
||||
}).Return(0, nil)
|
||||
s.mockedTimeoutPassedCall.Return(true)
|
||||
executionRequest := &dto.ExecutionRequest{}
|
||||
|
Reference in New Issue
Block a user