-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ci: optimize ParseLiveQuery.spec.js timeouts #7671
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -310,14 +310,10 @@ describe('ParseLiveQuery', function () { | |
Parse.Cloud.afterLiveQueryEvent('TestObject', req => { | ||
const current = req.object; | ||
const original = req.original; | ||
|
||
setTimeout(() => { | ||
done(); | ||
}, 2000); | ||
|
||
if (current.get('foo') != original.get('foo')) { | ||
req.sendEvent = false; | ||
} | ||
setTimeout(done, 1000); | ||
}); | ||
|
||
const query = new Parse.Query(TestObject); | ||
|
@@ -733,9 +729,7 @@ describe('ParseLiveQuery', function () { | |
}); | ||
object.set({ foo: 'bar' }); | ||
await object.save(); | ||
setTimeout(async () => { | ||
done(); | ||
}, 1000); | ||
setTimeout(done, 1000); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. unclear why this is 1000msec, reducing will probably not cause the test to fail but might falsely have it succeed.. |
||
}); | ||
|
||
it('can return a new beforeSubscribe query', async done => { | ||
|
@@ -922,9 +916,9 @@ describe('ParseLiveQuery', function () { | |
}); | ||
await obj1.save(); | ||
await Parse.User.logOut(); | ||
await new Promise(resolve => setTimeout(resolve, 200)); | ||
await new Promise(resolve => setTimeout(resolve, 100)); | ||
await obj2.save(); | ||
await new Promise(resolve => setTimeout(resolve, 200)); | ||
await new Promise(resolve => setTimeout(resolve, 100)); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. tried with 10msec but the test fails |
||
done(); | ||
}); | ||
|
||
|
@@ -978,8 +972,6 @@ describe('ParseLiveQuery', function () { | |
const client = await Parse.CoreManager.getLiveQueryController().getDefaultLiveQueryClient(); | ||
client.close(); | ||
// Wait for live query client to disconnect | ||
setTimeout(() => { | ||
done(); | ||
}, 1000); | ||
setTimeout(done, 10); | ||
}); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unclear why this is 1000msec, reducing will probably not cause the test to fail but might falsely have it succeed..