Skip to content

Commit 3f56e44

Browse files
committed
Revert "remove broken test (pgsql failure)"
This reverts commit 8f79a8f.
1 parent 41213e9 commit 3f56e44

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

tests/integration/actions_job_test.go

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -558,6 +558,28 @@ jobs:
558558
assert.Error(t, err)
559559
assert.Nil(t, resp)
560560

561+
// create an runner that picks a job and get force cancelled
562+
runnerToBeRemoved := newMockRunner()
563+
runnerToBeRemoved.registerAsRepoRunner(t, baseRepo.OwnerName, baseRepo.Name, "mock-runner-to-be-removed", []string{"ubuntu-latest"}, true)
564+
565+
taskToStopAPIObj := runnerToBeRemoved.fetchTask(t)
566+
567+
taskToStop := unittest.AssertExistsAndLoadBean(t, &actions_model.ActionTask{ID: taskToStopAPIObj.Id})
568+
569+
// verify CleanupEphemeralRunners does not remove the custom crafted runner
570+
actions_service.CleanupEphemeralRunners(t.Context())
571+
572+
runnerToRemove := unittest.AssertExistsAndLoadBean(t, &actions_model.ActionRunner{ID: taskToStop.RunnerID})
573+
574+
err = actions_model.StopTask(t.Context(), taskToStop.ID, actions_model.StatusFailure)
575+
assert.NoError(t, err)
576+
577+
// verify CleanupEphemeralRunners does remove the custom crafted runner
578+
actions_service.CleanupEphemeralRunners(t.Context())
579+
580+
unittest.AssertNotExistsBean(t, &actions_model.ActionRunner{ID: runnerToRemove.ID})#
581+
582+
// this cleanup is required to allow further tests to pass
561583
doAPIDeleteRepository(user2APICtx)(t)
562584
})
563585
}

0 commit comments

Comments
 (0)