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

Add test for clean exit from node #4556

Merged
merged 3 commits into from
May 9, 2022
Merged

Conversation

tomduncalf
Copy link
Contributor

@tomduncalf tomduncalf commented May 5, 2022

What, How & Why?

This reproduces #4535

☑️ ToDos

  • 📝 Changelog entry
  • 📝 Compatibility label is updated or copied from previous entry
  • 🚦 Tests
  • 📱 Check the React Native/other sample apps work if necessary
  • 📝 Public documentation PR created or is not necessary
  • 💥 Breaking label has been applied or is not necessary

If this PR adds or changes public API's:

  • typescript definitions file is updated
  • jsdoc files updated
  • Chrome debug API is updated if API is available on React Native

@tomduncalf tomduncalf force-pushed the td/4535-node-clean-exit branch from 232459d to 6767d91 Compare May 5, 2022 10:07
execSync(
`node -e 'const Realm = require("realm"); const app = new Realm.App({ id: "myapp-abcde" }); Realm.clearTestState();'`,
{
timeout: 5000,
Copy link
Member

@kraenhansen kraenhansen May 5, 2022

Choose a reason for hiding this comment

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

I think this extends the timeout of the test? I.e. if it takes 3 seconds for the process to exit, it will fail although it didn't timeout. Could we read this timeout from the test's context instead?

Suggested change
timeout: 5000,
timeout: this.timeout - 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.

Ah yeah, good spot. How about this change: 924c7db so that it never exceeds either the test timeout or 5000ms?

I think 5000ms should always be enough for this test in any case, if you were running the suite with say 60 second timeout for some reason, there's no point in this one waiting for 60 seconds also.

Copy link
Member

Choose a reason for hiding this comment

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

Good idea 👍 Looks great.

@tomduncalf tomduncalf force-pushed the td/4535-node-clean-exit branch from 88213ea to 924c7db Compare May 6, 2022 08:53
@tomduncalf tomduncalf merged commit 60f2a5f into master May 9, 2022
@tomduncalf tomduncalf deleted the td/4535-node-clean-exit branch May 9, 2022 08:04
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 15, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants