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

chore: test re-loading manager with the same data #581

Merged
merged 1 commit into from
Apr 24, 2024

Conversation

EvanHahn
Copy link
Contributor

This test-only change creates a project. Then, it makes a new manager with the same files and asserts that the project is still there.

Because the only way to close a manager is to close the Node process, this test adds a bunch of scaffolding to do that.

This test-only change creates a project. Then, it makes a new manager
with the same files and asserts that the project is still there.

Because the only way to close a manager is to close the Node process,
this test adds a bunch of scaffolding to do that.
`

const result = temporaryFile({ extension: 'mjs' })
this.#t.teardown(() => fsPromises.rm(result, { maxRetries: 2 }))
Copy link
Contributor

@tomasciccola tomasciccola Apr 24, 2024

Choose a reason for hiding this comment

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

only nit, why is there two calls to t.teardown (one here, and one in the constructor)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

dbFolder and coreStorage are created once per ManagerCustodian. These JS files are created once per call to withManagerInSeparateProcess.

In my test, for example, dbFolder is created once (and therefore needs to be removed once) and the JS file is created twice (and therefore needs to be removed twice).

Does that answer your question?

@EvanHahn EvanHahn merged commit b62caef into main Apr 24, 2024
4 checks passed
@EvanHahn EvanHahn deleted the manager-restart-test branch April 24, 2024 17:58
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