Skip to content
This repository has been archived by the owner on Jan 10, 2023. It is now read-only.

Commit

Permalink
Remove cancel pull big image test
Browse files Browse the repository at this point in the history
This test doesn't make too much sense anymore, because
the pulls are independent from one another.
  • Loading branch information
sargun committed May 14, 2018
1 parent 10d0b1d commit 3c9c6b7
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 100 deletions.
47 changes: 0 additions & 47 deletions executor/mock/standalone/standalone_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,6 @@ var (
name: "titusoss/by-digest",
tag: "latest",
}
bigImage = testImage{
name: "titusoss/big-image",
tag: "20171025-1508900976",
}
noEntrypoint = testImage{
name: "titusoss/no-entrypoint",
tag: "20180501-1525157430",
Expand Down Expand Up @@ -87,7 +83,6 @@ func TestStandalone(t *testing.T) {
testNoEntrypoint,
testCanWriteInLogsAndSubDirs,
testShutdown,
testCancelPullBigImage,
testMetadataProxyInjection,
testMetdataProxyDefaultRoute,
testTerminateTimeout,
Expand Down Expand Up @@ -323,48 +318,6 @@ func testImagePullError(t *testing.T, jobID string) {
}
}

func testCancelPullBigImage(t *testing.T, jobID string) { // nolint: gocyclo
jobRunner := mock.NewJobRunner()

testResultBigImage := jobRunner.StartJob(&mock.JobInput{
JobID: jobID,
ImageName: bigImage.name,
Version: bigImage.tag,
})

select {
case taskStatus := <-testResultBigImage.UpdateChan:
if taskStatus.State.String() != "TASK_STARTING" {
t.Fatal("Task never observed in TASK_STARTING, instead: ", taskStatus)
}
case <-time.After(15 * time.Second):
t.Fatal("Spent too long waiting for task starting")
}

if err := jobRunner.KillTask(); err != nil {
t.Fatal("Could not stop task: ", err)
}
timeOut := time.After(30 * time.Second)
for {
select {
case taskStatus := <-testResultBigImage.UpdateChan:
// t.Log("Observed task status: ", taskStatus)
if taskStatus.State.String() == "TASK_RUNNING" {
t.Fatalf("Task %s started after killTask %v", testResultBigImage.TaskID, taskStatus)
}
if taskStatus.State.String() == "TASK_KILLED" || taskStatus.State.String() == "TASK_LOST" {
t.Logf("Task %s successfully terminated with status %s", testResultBigImage.TaskID, taskStatus.State.String())
goto big_task_killed
}
case <-timeOut:
t.Fatal("Cancel failed to stop job in time")
}
}
big_task_killed:
// We do this here, otherwise a stuck executor can prevent this from exiting.
jobRunner.StopExecutor()
}

func testBadEntrypoint(t *testing.T, jobID string) {
ji := &mock.JobInput{
ImageName: alpine.name,
Expand Down
53 changes: 0 additions & 53 deletions hack/test-images/big-image/Dockerfile

This file was deleted.

0 comments on commit 3c9c6b7

Please sign in to comment.