Skip to content

Commit a81ab4d

Browse files
committed
wait between Docker operations
1 parent 7cecbf4 commit a81ab4d

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Docker.test.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -553,6 +553,8 @@ const test5 = new Test('Docker - swarm', async function integration() {
553553
this.serviceId2 = serviceId
554554
}
555555

556+
await sleep(1000)
557+
556558
{ // updateService
557559
const data1 = await docker.updateService('service2', {
558560
image: 'node:17-alpine',
@@ -568,6 +570,9 @@ const test5 = new Test('Docker - swarm', async function integration() {
568570

569571
{ // listServices
570572
const data = await docker.listServices()
573+
while (data.length < 2) {
574+
await sleep(1000)
575+
}
571576
assert.equal(data.length, 2)
572577
const serviceIds = data.map(get('ID'))
573578
assert(serviceIds.includes(this.serviceId1))
@@ -576,6 +581,9 @@ const test5 = new Test('Docker - swarm', async function integration() {
576581

577582
{ // listTasks
578583
const data = await docker.listTasks()
584+
while (data.length < 4) {
585+
await sleep(1000)
586+
}
579587
assert.equal(data.length, 4, data) // 2 for service1, 1 for service2 (global), 1 for service2 (update)
580588
for (const item of data) {
581589
assert.equal(typeof item.ID, 'string')

0 commit comments

Comments
 (0)