Skip to content
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

Closed

Conversation

FransGH
Copy link
Contributor

@FransGH FransGH commented Oct 30, 2021

New Pull Request Checklist

Issue Description

Potential unnecessary long timeouts for the test.

Related issue: #7659

Approach

Reduced timeouts resulting in 5x speedup.

TODOs before merging

  • A changelog entry is created automatically using the pull request title (do not manually add a changelog entry)

@parse-github-assistant
Copy link

Thanks for opening this pull request!

  • 🎉 We are excited about your hands-on contribution!

@FransGH
Copy link
Contributor Author

FransGH commented Oct 30, 2021

@mtrezza, after my last comment in the earlier PR I remained courious how much this could be further optimised. Hope this helps... (main change is the reduced tmo in afterEach from 1000 to 10msec)

@codecov
Copy link

codecov bot commented Oct 30, 2021

Codecov Report

❗ No coverage uploaded for pull request base (release-4.x.x@065facd). Click here to learn what that means.
The diff coverage is n/a.

Impacted file tree graph

@@               Coverage Diff                @@
##             release-4.x.x    #7671   +/-   ##
================================================
  Coverage                 ?   93.21%           
================================================
  Files                    ?      169           
  Lines                    ?    12442           
  Branches                 ?        0           
================================================
  Hits                     ?    11598           
  Misses                   ?      844           
  Partials                 ?        0           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 065facd...be67738. Read the comment docs.

@@ -5,6 +5,8 @@ const validatorFail = () => {
throw 'you are not authorized';
};

console.log('jasmine.ASYNC_TEST_WAIT_TIME=' + jasmine.ASYNC_TEST_WAIT_TIME);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this needs to be removed...

await obj2.save();
await new Promise(resolve => setTimeout(resolve, 200));
await new Promise(resolve => setTimeout(resolve, 100));
Copy link
Contributor Author

Choose a reason for hiding this comment

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

tried with 10msec but the test fails

if (current.get('foo') != original.get('foo')) {
req.sendEvent = false;
}
setTimeout(done, 1000);
Copy link
Contributor Author

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

setTimeout(async () => {
done();
}, 1000);
setTimeout(done, 1000);
Copy link
Contributor Author

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

subscription.unsubscribe();
const client = await Parse.CoreManager.getLiveQueryController().getDefaultLiveQueryClient();
client.close();
await new Promise(resolve => setTimeout(resolve, 10));
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this is the key change, was 1000msec

@FransGH
Copy link
Contributor Author

FransGH commented Oct 30, 2021

Hi @dblythy, would you mind having a quick look at this? Anything in here that might negatively change the outcome of a test (especially false positives)?

@FransGH FransGH force-pushed the ci-uptimize-timeouts branch from 3a46302 to be67738 Compare October 30, 2021 23:20
@mtrezza
Copy link
Member

mtrezza commented Oct 31, 2021

I haven't looked at the individual changes, but generally I'd say:

  • different timeout lengths may be required depending on the tests
  • to approximate a min. timeout, I suggest running the test locally, which may be quicker than waiting for the GH CI to run

While this PR focuses on reducing the individual test run, there is another optimization perspective which is reducing the overall compute time. These two are currently the same, but they don't have to be. I opened #7672 for details.

@mtrezza
Copy link
Member

mtrezza commented Jan 26, 2023

Closing as the base branch of this PR release-4.x.x is a LTS branch that is no longer maintained. To further pursue this optimization please open a new PR with the alpha branch as the base branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants