fix: address review findings for self-update (#15)
This commit is contained in:
@@ -500,6 +500,21 @@ func TestMixedAutoAndManual(t *testing.T) {
|
||||
assert.Len(t, e.store.avail, 3)
|
||||
}
|
||||
|
||||
func TestAgentsOwnServiceIsStartedLast(t *testing.T) {
|
||||
own := compose(1, model.ModeAuto, slusk+":1")
|
||||
own.Self = true
|
||||
e := newEnv(t, own, compose(2, model.ModeAuto, slusk+":1"))
|
||||
e.jobs.jobFor[1] = model.Job{Status: model.JobSucceeded}
|
||||
e.jobs.jobFor[2] = model.Job{Status: model.JobSucceeded}
|
||||
|
||||
e.post(`{"image":"` + slusk + `","tag":"2"}`)
|
||||
|
||||
calls := e.jobs.startCalls()
|
||||
require.Len(t, calls, 2)
|
||||
assert.Equal(t, int64(2), calls[0].svc.ID)
|
||||
assert.Equal(t, int64(1), calls[1].svc.ID)
|
||||
}
|
||||
|
||||
func TestClientCancelStopsWaitingButNotStarting(t *testing.T) {
|
||||
e := newEnv(t, compose(1, model.ModeAuto, slusk+":1.4.2"))
|
||||
e.h.cfg.Timeout = time.Minute
|
||||
|
||||
Reference in New Issue
Block a user