chore: attempt to fix flaky test (#2197)

This commit is contained in:
Nolan Lawson 2022-11-17 17:09:24 -08:00 committed by GitHub
parent 55189e840b
commit 3c59069490
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -17,10 +17,10 @@ export async function restoreMastodonData () {
console.log('Restoring mastodon data...') console.log('Restoring mastodon data...')
const internalIdsToIds = {} const internalIdsToIds = {}
for (const action of actions) { for (const action of actions) {
if (!action.post) { if (!action.post || /@/.test(action.post.text)) {
// If the action is a boost, favorite, etc., then it needs to // 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. // 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)) console.log(JSON.stringify(action))
const accessToken = users[action.user].accessToken const accessToken = users[action.user].accessToken