Skip to content

Use env::temp_dir() for BP tests #2234

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

Merged
merged 1 commit into from
Apr 26, 2023

Conversation

dunxen
Copy link
Contributor

@dunxen dunxen commented Apr 26, 2023

Currently BackgroundProcessor tests create persister directories in the current working directory and rely on cleaning up in a Drop implementation.

Unfortunately, it seems that in the async tests that nodes are not drop()ed for some reason and so the directories created by those tests remain behind in the current working directory.

This commit at least ensures that these test directories are created in a temporary location for the OS using temp_dir(). It doesn't aim to solve the lack of cleanup in the async tests.

Partial fix for #2224, but I believe it's enough to resolve it as these temp directories that do remain will be purged by the OS at some stage and are overwritten by subsequent tests if there is a conflict.

Currently `BackgroundProcessor` tests create persister directories in the
current working directory and rely on cleaning up in a `Drop` implementation.

Unfortunately, it seems that in the async tests that nodes are not
`drop()`ed for some reason and so the directories created by those
tests remain behind in the current working directory.

This commit at least ensures that these test directories are created in
a temporary location for the OS using `temp_dir()`. It doesn't aim to
solve the lack of cleanup in the async tests.

Partial fix for lightningdevkit#2224 but I believe it's enough to resolve it as these
temp directories that do remain will be purged by the OS at some stage
and are overwritten by subsequent tests if there is a conflict.
@TheBlueMatt TheBlueMatt merged commit 4f806f5 into lightningdevkit:main Apr 26, 2023
@dunxen dunxen deleted the 2023-04-bpteststemp branch January 20, 2025 08:34
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.

3 participants