Skip to content

made TestEnv able to run the tests in parallel, which reduced the tes…#146

Merged
ChrisSon15 merged 3 commits intobisq-network:mainfrom
ChrisSon15:main
Apr 13, 2026
Merged

made TestEnv able to run the tests in parallel, which reduced the tes…#146
ChrisSon15 merged 3 commits intobisq-network:mainfrom
ChrisSon15:main

Conversation

@ChrisSon15
Copy link
Copy Markdown
Collaborator

…t time on my end from 4m to 1m.

Also remove unneeded tmp_dir

…t time on my end from 4m to 1m.

Also remove unneeded tmp_dir
@ChrisSon15 ChrisSon15 requested a review from sdmg15 April 8, 2026 18:33
Copy link
Copy Markdown
Contributor

@stejbac stejbac left a comment

Choose a reason for hiding this comment

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

In addition to the in-code suggestions, we should remove simple-semaphore from the Cargo manifest, as it is no longer a crate dependency after these changes.

Comment thread testenv/src/lib.rs Outdated
Comment thread testenv/src/lib.rs Outdated
Comment thread testenv/src/lib.rs Outdated
Comment thread testenv/src/lib.rs Outdated
// let permit = SEMAPHORE.acquire(); // have testenvs single threaded because of bitcoind
// and electrs references.
let tmp_dir = tempdir().expect("failed to create temporary directory");
std::env::set_current_dir(tmp_dir.path()).expect("failed to set current directory");
Copy link
Copy Markdown
Contributor

@stejbac stejbac Apr 8, 2026

Choose a reason for hiding this comment

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

I don't see how setting the current directory can possibly work in parallel, without being protected by a global mutex/semaphore held by whatever is relying on it being a particular path.

I really don't think anything (other than possibly some very top level application startup code) should care about the current directory, and it should be completely unaffected by its value. If that's not the case, we should change it.

--

Furthermore, after removing the _tmp_dir field from the struct, the tmp_dir local variable will be immediately dropped after having set the current directory to it, so the current directory will be pointing to an invalid/stale path.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

The tmp_dir was a left over not used.
Temp directories now need to be created when needed.
thanks for spotting

Copy link
Copy Markdown
Contributor

@sdmg15 sdmg15 left a comment

Choose a reason for hiding this comment

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

Image Image

Tests are flaky. This is related to the comment made by stejbac.

Copy link
Copy Markdown
Contributor

@stejbac stejbac left a comment

Choose a reason for hiding this comment

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

utACK

(simple-semaphore still needs to be removed from the testenv Cargo manifest, though.)

Copy link
Copy Markdown
Contributor

@sdmg15 sdmg15 left a comment

Choose a reason for hiding this comment

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

tAck

@ChrisSon15 ChrisSon15 requested a review from sdmg15 April 10, 2026 21:55
Comment thread test-runner.sh
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Not sure you really want to push this?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

yes, but will delete it soon when no longer needed. So its just temporarly

@ChrisSon15 ChrisSon15 merged commit 95d590f into bisq-network:main Apr 13, 2026
3 checks passed
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