Skip to content

Commit

Permalink
chore: revert pod spec and test changes (#8920)
Browse files Browse the repository at this point in the history
  • Loading branch information
NicholasBlaskey committed Feb 29, 2024
1 parent 1dfd6d9 commit cd88bb5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
18 changes: 10 additions & 8 deletions master/internal/rm/kubernetesrm/pod_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"time"

"github.com/google/uuid"
"github.com/pkg/errors"
"github.com/stretchr/testify/require"
"gotest.tools/assert"

Expand Down Expand Up @@ -167,6 +168,8 @@ func checkReceiveTermination(
func TestResourceCreationFailed(t *testing.T) {
setupEntrypoint(t)

const correctMsg = "already exists"

ref, aID, sub := createPodWithMockQueue(t, nil)

purge(aID, sub)
Expand All @@ -176,15 +179,14 @@ func TestResourceCreationFailed(t *testing.T) {
require.NoError(t, err)
time.Sleep(time.Second)

// We expect three messages in the queue because the pod actor sends itself a stop message.
assert.Equal(t, sub.Len(), 3)
// We expect two messages in the queue because the pod actor sends itself a stop message.
assert.Equal(t, sub.Len(), 2)
message := sub.Get()
require.IsType(t, &sproto.ContainerLog{}, message)
require.Contains(t, *message.(*sproto.ContainerLog).AuxMessage, "Pod Spec Configured")

message = sub.Get()
require.IsType(t, &sproto.ContainerLog{}, message)
require.Contains(t, *message.(*sproto.ContainerLog).AuxMessage, "already exists")
containerMsg, ok := message.(*sproto.ContainerLog)
if !ok {
t.Errorf("expected sproto.ContainerLog but received %s", reflect.TypeOf(message))
}
assert.ErrorContains(t, errors.New(*containerMsg.AuxMessage), correctMsg)
}

func TestReceivePodStatusUpdateTerminated(t *testing.T) {
Expand Down
2 changes: 0 additions & 2 deletions master/internal/rm/kubernetesrm/spec.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import (
"reflect"
"strconv"
"strings"
"time"

"github.com/determined-ai/determined/master/internal/config"

Expand Down Expand Up @@ -481,7 +480,6 @@ func (p *pod) createPodSpec(scheduler string) error {

p.pod = p.configurePodSpec(
volumes, initContainer, container, sidecars, (*k8sV1.Pod)(env.PodSpec()), scheduler)
p.insertLog(time.Now().UTC(), fmt.Sprintf("Pod Spec Configured:\n%v\n", p.pod.Spec))
return nil
}

Expand Down

0 comments on commit cd88bb5

Please sign in to comment.