From 14945e0052c24f764d2a1a4115c64e0b210d7f7e Mon Sep 17 00:00:00 2001 From: Jason Dobry Date: Sat, 7 Jan 2017 13:56:06 -0800 Subject: [PATCH] Stabilize some tests --- pubsub/system-test/subscriptions.test.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/pubsub/system-test/subscriptions.test.js b/pubsub/system-test/subscriptions.test.js index 126b3ab019f..3da16770064 100644 --- a/pubsub/system-test/subscriptions.test.js +++ b/pubsub/system-test/subscriptions.test.js @@ -126,10 +126,12 @@ test.serial(`should pull ordered messages`, async (t) => { results = await pubsub.topic(topicNameTwo).publish({ data: expected, attributes: { counterId: '1' } }, { raw: true }); results = await pubsub.topic(topicNameTwo).publish({ data: expected, attributes: { counterId: '2' } }, { raw: true }); publishedMessageIds.push(results[0][0]); - await subscriptions.pullOrderedMessages(subscriptionNameThree); - t.is(console.log.callCount, 3); - t.deepEqual(console.log.secondCall.args, [`* %d %j %j`, publishedMessageIds[2], expected, { counterId: '2' }]); - t.deepEqual(console.log.thirdCall.args, [`* %d %j %j`, publishedMessageIds[0], expected, { counterId: '3' }]); + await tryTest(async () => { + await subscriptions.pullOrderedMessages(subscriptionNameThree); + t.is(console.log.callCount, 3); + t.deepEqual(console.log.secondCall.args, [`* %d %j %j`, publishedMessageIds[2], expected, { counterId: '2' }]); + t.deepEqual(console.log.thirdCall.args, [`* %d %j %j`, publishedMessageIds[0], expected, { counterId: '3' }]); + }); }); test.serial(`should set the IAM policy for a subscription`, async (t) => {