Skip to content

Commit

Permalink
test(storage, e2e): fixture seed in series not parallel
Browse files Browse the repository at this point in the history
this has been flaky in production for a while on android and ios,
I have a hunch that the Promise.all doing storage emulator work in
parallel is causing a hang in the emulator since it does not reproduce
locally (hinting at a timing issue since CI is a different speed...)
  • Loading branch information
mikehardy committed Jan 4, 2022
1 parent 208cb6b commit 454dc70
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions packages/storage/e2e/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,20 +35,22 @@ exports.seed = async function seed(path) {
},
});

return Promise.all([
try {
// Add a write only file
firebase.storage().ref(WRITE_ONLY_NAME).putString('Write Only'),
await firebase.storage().ref(WRITE_ONLY_NAME).putString('Write Only');

// Setup list items - Future.wait not working...
firebase
await firebase
.storage()
.ref(`${path}/list/file1.txt`)
.putString('File 1', 'raw', { contentType: 'text/plain' }),
firebase.storage().ref(`${path}/list/file2.txt`).putString('File 2'),
firebase.storage().ref(`${path}/list/file3.txt`).putString('File 3'),
firebase.storage().ref(`${path}/list/file4.txt`).putString('File 4'),
firebase.storage().ref(`${path}/list/nested/file5.txt`).putString('File 5'),
]);
.putString('File 1', 'raw', { contentType: 'text/plain' });
await firebase.storage().ref(`${path}/list/file2.txt`).putString('File 2');
await firebase.storage().ref(`${path}/list/file3.txt`).putString('File 3');
await firebase.storage().ref(`${path}/list/file4.txt`).putString('File 4');
await firebase.storage().ref(`${path}/list/nested/file5.txt`).putString('File 5');
} catch (e) {
throw new Error('unable to seed storage service with test fixture: ' + e);
}
};

exports.wipe = function wipe(path) {
Expand Down

1 comment on commit 454dc70

@vercel
Copy link

@vercel vercel bot commented on 454dc70 Jan 4, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.