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

marine_test: change directory mapping between tests #7

Open
folex opened this issue Jul 29, 2021 · 1 comment
Open

marine_test: change directory mapping between tests #7

folex opened this issue Jul 29, 2021 · 1 comment
Labels
enhancement New feature or request

Comments

@folex
Copy link
Member

folex commented Jul 29, 2021

Currently, if a service writes some state to the disk by a static file name, this state is shared between different tests. This leads to 2 things:

  1. Tests can't run in parallel because of an implicit shared state
  2. Each test has to clean state on the disk (either in the beginning, or at the end, or even both)

This makes tests very fragile and cluttered: forget to clean state and you have a failing test that is really hard to debug.

I think the situation can be improved by generating directory mapping randomly. For example, /tmp can be mapped to /tmp/$UUID on the host.

@folex
Copy link
Member Author

folex commented Jul 29, 2021

Here's an example of defensive state-cleaning in AquaDHT tests: https://github.com/fluencelabs/aqua-dht/blob/9a729611c6da4930b5f145696bfdc975d1227e77/service/src/tests.rs#L127

@ValeryAntopol ValeryAntopol transferred this issue from fluencelabs/marine-rs-sdk Oct 11, 2021
@ValeryAntopol ValeryAntopol added the enhancement New feature or request label Nov 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants