From 3c590694909cfd76ea89d45a4e3f886fb0ca11f4 Mon Sep 17 00:00:00 2001 From: Nolan Lawson Date: Thu, 17 Nov 2022 17:09:24 -0800 Subject: [PATCH] chore: attempt to fix flaky test (#2197) --- bin/restore-mastodon-data.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/restore-mastodon-data.js b/bin/restore-mastodon-data.js index c519cb13..09234e0b 100644 --- a/bin/restore-mastodon-data.js +++ b/bin/restore-mastodon-data.js @@ -17,10 +17,10 @@ export async function restoreMastodonData () { console.log('Restoring mastodon data...') const internalIdsToIds = {} for (const action of actions) { - if (!action.post) { - // If the action is a boost, favorite, etc., then it needs to + if (!action.post || /@/.test(action.post.text)) { + // If the action is a boost, favorite, mention, etc., then it needs to // be delayed, otherwise it may appear in an unpredictable order and break the tests. - await new Promise(resolve => setTimeout(resolve, 1000)) + await new Promise(resolve => setTimeout(resolve, 1500)) } console.log(JSON.stringify(action)) const accessToken = users[action.user].accessToken