@@ -998,7 +998,11 @@ func TestDeploymentWatcher_Watch_ProgressDeadline(t *testing.T) {
998998 Healthy : pointer .Of (false ),
999999 Timestamp : now ,
10001000 }
1001- must .NoError (t , m .state .UpdateAllocsFromClient (structs .MsgTypeTestSetup , 100 , []* structs.Allocation {a2 }))
1001+
1002+ updateReq := structs.AllocUpdateRequest {
1003+ Alloc : []* structs.Allocation {a2 },
1004+ }
1005+ must .NoError (t , m .state .UpdateAllocsFromClient (structs .MsgTypeTestSetup , 100 , updateReq ))
10021006
10031007 // Wait for the deployment to be failed
10041008 must .Wait (t , wait .InitialSuccess (wait .BoolFunc (func () bool {
@@ -1149,7 +1153,11 @@ func TestDeploymentWatcher_Watch_ProgressDeadline_Canaries(t *testing.T) {
11491153 Healthy : pointer .Of (true ),
11501154 Timestamp : now ,
11511155 }
1152- must .NoError (t , m .state .UpdateAllocsFromClient (structs .MsgTypeTestSetup , m .nextIndex (), []* structs.Allocation {a2 }))
1156+
1157+ updateReq := structs.AllocUpdateRequest {
1158+ Alloc : []* structs.Allocation {a2 },
1159+ }
1160+ must .NoError (t , m .state .UpdateAllocsFromClient (structs .MsgTypeTestSetup , m .nextIndex (), updateReq ))
11531161
11541162 // Wait for the deployment to cross the deadline
11551163 dout , err := m .state .DeploymentByID (nil , d .ID )
@@ -1320,8 +1328,11 @@ func TestDeploymentWatcher_ProgressDeadline_LatePromote(t *testing.T) {
13201328 Timestamp : now ,
13211329 }
13221330
1323- allocs = []* structs.Allocation {canary2 }
1324- err := m .state .UpdateAllocsFromClient (mtype , m .nextIndex (), allocs )
1331+ updateReq := structs.AllocUpdateRequest {
1332+ Alloc : []* structs.Allocation {canary2 },
1333+ }
1334+
1335+ err := m .state .UpdateAllocsFromClient (mtype , m .nextIndex (), updateReq )
13251336 must .NoError (t , err )
13261337
13271338 // wait for long enough to ensure we read deployment update channel
@@ -1339,8 +1350,11 @@ func TestDeploymentWatcher_ProgressDeadline_LatePromote(t *testing.T) {
13391350 Timestamp : now ,
13401351 }
13411352
1342- allocs = []* structs.Allocation {canary1 }
1343- err = m .state .UpdateAllocsFromClient (mtype , m .nextIndex (), allocs )
1353+ updateReq2 := structs.AllocUpdateRequest {
1354+ Alloc : []* structs.Allocation {canary1 },
1355+ }
1356+
1357+ err = m .state .UpdateAllocsFromClient (mtype , m .nextIndex (), updateReq2 )
13441358 must .NoError (t , err )
13451359
13461360 // ensure progress_deadline has definitely expired
@@ -1406,8 +1420,11 @@ func TestDeploymentWatcher_ProgressDeadline_LatePromote(t *testing.T) {
14061420 Timestamp : now ,
14071421 }
14081422
1409- allocs = []* structs.Allocation {alloc1a , alloc1b }
1410- err = m .state .UpdateAllocsFromClient (mtype , m .nextIndex (), allocs )
1423+ updateReq3 := structs.AllocUpdateRequest {
1424+ Alloc : []* structs.Allocation {alloc1a , alloc1b },
1425+ }
1426+
1427+ err = m .state .UpdateAllocsFromClient (mtype , m .nextIndex (), updateReq3 )
14111428 must .NoError (t , err )
14121429
14131430 // ensure any progress deadline has expired
@@ -1470,7 +1487,12 @@ func TestDeploymentWatcher_Watch_StartWithoutProgressDeadline(t *testing.T) {
14701487 Healthy : pointer .Of (false ),
14711488 Timestamp : time .Now (),
14721489 }
1473- must .NoError (t , m .state .UpdateAllocsFromClient (structs .MsgTypeTestSetup , m .nextIndex (), []* structs.Allocation {a2 }))
1490+
1491+ updateReq := structs.AllocUpdateRequest {
1492+ Alloc : []* structs.Allocation {a2 },
1493+ }
1494+
1495+ must .NoError (t , m .state .UpdateAllocsFromClient (structs .MsgTypeTestSetup , m .nextIndex (), updateReq ))
14741496
14751497 // Wait for the alloc's DesiredState to set reschedule
14761498 must .Wait (t , wait .InitialSuccess (wait .ErrorFunc (func () error {
@@ -1528,7 +1550,12 @@ func TestDeploymentWatcher_Watch_FailEarly(t *testing.T) {
15281550 Healthy : pointer .Of (false ),
15291551 Timestamp : now ,
15301552 }
1531- must .Nil (t , m .state .UpdateAllocsFromClient (structs .MsgTypeTestSetup , m .nextIndex (), []* structs.Allocation {a2 }))
1553+
1554+ updateReq := structs.AllocUpdateRequest {
1555+ Alloc : []* structs.Allocation {a2 },
1556+ }
1557+
1558+ must .Nil (t , m .state .UpdateAllocsFromClient (structs .MsgTypeTestSetup , m .nextIndex (), updateReq ))
15321559
15331560 // Wait for the deployment to be failed
15341561 must .Wait (t , wait .InitialSuccess (wait .ErrorFunc (func () error {
0 commit comments