Skip to content

Commit 32e16bd

Browse files
committed
test(e2e): de-flake some e2e tests with sleeps
1 parent 09ebe84 commit 32e16bd

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

packages/database/e2e/query/once.e2e.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -116,14 +116,15 @@ describe('database().ref().once()', function () {
116116
}
117117
});
118118

119+
// TODO flaky android
119120
it('it calls when a child is added', async function () {
120121
const value = Date.now();
121122
const callback = sinon.spy();
122123
const ref = firebase.database().ref(`${TEST_PATH}/childAdded`);
123124

124125
ref.once('child_added').then($ => callback($.val()));
125126
await ref.child('foo').set(value);
126-
await Utils.sleep(1000);
127+
await Utils.sleep(2000);
127128

128129
callback.should.be.calledOnce();
129130
callback.should.be.calledWith(value);
@@ -135,9 +136,9 @@ describe('database().ref().once()', function () {
135136

136137
await ref.child('foo').set(1);
137138
ref.once('child_changed').then($ => callback($.val()));
138-
await Utils.sleep(1000);
139+
await Utils.sleep(2000);
139140
await ref.child('foo').set(2);
140-
await Utils.sleep(1000);
141+
await Utils.sleep(2000);
141142
callback.should.be.calledOnce();
142143
callback.should.be.calledWith(2);
143144
});
@@ -149,9 +150,9 @@ describe('database().ref().once()', function () {
149150
await child.set('foo');
150151

151152
ref.once('child_removed').then($ => callback($.val()));
152-
await Utils.sleep(1000);
153+
await Utils.sleep(2000);
153154
await child.remove();
154-
await Utils.sleep(1000);
155+
await Utils.sleep(2000);
155156

156157
callback.should.be.calledOnce();
157158
callback.should.be.calledWith('foo');

packages/database/e2e/reference/push.e2e.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ describe('database().ref().push()', function () {
6767
ref.push(value, () => {
6868
callback();
6969
});
70-
await Utils.sleep(1000);
70+
await Utils.sleep(2000);
7171
callback.should.be.calledOnce();
7272
});
7373

@@ -86,7 +86,7 @@ describe('database().ref().push()', function () {
8686
error.message.should.containEql("doesn't have permission to access");
8787
callback();
8888
});
89-
await Utils.sleep(1000);
89+
await Utils.sleep(2000);
9090
callback.should.be.calledOnce();
9191
});
9292
});

packages/firestore/e2e/QuerySnapshot.e2e.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ describe('firestore.QuerySnapshot', function () {
163163
.collection(`${COLLECTION}/${Utils.randString(12, '#aA')}/metadatachanges-true-false`);
164164
const unsub = colRef.onSnapshot({ includeMetadataChanges: true }, callback);
165165
await colRef.add({ foo: 'bar' });
166-
await Utils.spyToBeCalledTimesAsync(callback, 3);
166+
await Utils.spyToBeCalledTimesAsync(callback, 3, 10000);
167167
unsub();
168168

169169
const snap1 = callback.args[0][0];

0 commit comments

Comments
 (0)