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

Parallel nature of tests execution and Bee's mutex for blockchain operations #433

Open
AuHau opened this issue Oct 13, 2021 · 0 comments
Open
Labels

Comments

@AuHau
Copy link
Contributor

AuHau commented Oct 13, 2021

Problem

Bee allows only one API call that create a blockchain transactions. Recently, they improved the API which now returns "429 Too Many Requests" if there is already pending transactions that awaits resolution.

Jest executes test in parallel using multi-execution environment (I believe it uses Worker Threads), which can lead to introduction of more flaky test environment if the blockchain-related integration tests will be executed in the same time.

To my understanding Jest paralelise the top level describe entities, while keeping everything in the describe serially executed (see here). Thanks to that we have not run into this issue, but if we gonna expand our integration testing this might become more important.

Solutions

Abond parallelism

Jest allows execute all tests in serial, but we would take a big hit on the performance (almost double the execution time).

External synchronization

From my brief research I have not find a way how to communicate between the workers to sync execution of only one blockchain test.

There is possibility to use file-system and have lock-file, yet I am not sure how good idea it is also from performance point of view.

Split blockchain-relate tests

We could refactor the blockchain related tests into separate group, which would be executed serially while all the other tests would be still kept running parallel.

@AuHau AuHau added the kind:test Testing work label Oct 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant