chore: attempt to fix flaky test (#2197)

nonbreak
Nolan Lawson 2022-11-17 17:09:24 -08:00 zatwierdzone przez GitHub
rodzic 55189e840b
commit 3c59069490
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
1 zmienionych plików z 3 dodań i 3 usunięć

Wyświetl plik

@ -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