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

[Test] Speed up functional tests #2914

Merged

Conversation

panleone
Copy link

@panleone panleone commented Mar 20, 2024

The aim of this PR is making functional test run faster

First commit:
Sleeping inside wait_for_rpc_connection is useless since in case of failure it will try again rather than throwing error.

Second commit:
profiling showed that waiting for all nodes to connect to each other was very slow (8 nodes took about ~32 seconds on my PC). If we connect them in parallel time is much faster ( more or less 4 seconds on my PC)

Third commit:
sleeping inside is_node_stopped is useless since it is always used in operations like wait_until_stopped, and in case a node is not stopped it will wait and try again rather than throwing error.

Fourth commit:
removed many other big time.sleep() that made everything go overall much slower. This is the only commit that I'm not 100% sure so if we see that some test fail at the beginning (I mean before run_test() is called) this one can be reverted.

Fifth commit:
Make faster and solve the failure of p2p_invalid_messages.py:
When receiving lots of messages use a timeout system, instead of sleeping for an arbitrary amount of time (30 seconds, which sometimes was not enough)

@panleone panleone added the Tests label Mar 20, 2024
@panleone panleone added this to the 6.0.0 milestone Mar 20, 2024
@panleone panleone self-assigned this Mar 20, 2024
@panleone panleone changed the title [Test] Do not randomly sleep for 5 seconds [Test] Speed up functional tests Mar 20, 2024
@panleone panleone force-pushed the fast_functional_tests_attempt_1 branch from 12bd1b4 to e2c7d90 Compare March 20, 2024 18:11
@panleone panleone force-pushed the fast_functional_tests_attempt_1 branch 3 times, most recently from f34ab07 to b13c6e7 Compare March 21, 2024 08:27
@panleone panleone force-pushed the fast_functional_tests_attempt_1 branch from b13c6e7 to 26ed4d4 Compare March 21, 2024 08:28
Copy link
Member

@Liquid369 Liquid369 left a comment

Choose a reason for hiding this comment

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

tACK 26ed4d4
Logically all these changes check out, I've reran the tests a few times on my own and they all have been successful.
Much needed improvements and very happy that we can speed up the test suite.

Copy link
Member

@Duddino Duddino left a comment

Choose a reason for hiding this comment

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

utACK 26ed4d4

Copy link
Collaborator

@Fuzzbawls Fuzzbawls left a comment

Choose a reason for hiding this comment

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

ACK 26ed4d4

Nice speed up in the test suite

@Fuzzbawls Fuzzbawls merged commit efaa521 into PIVX-Project:master Mar 23, 2024
21 checks passed
@panleone panleone deleted the fast_functional_tests_attempt_1 branch March 25, 2024 09:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants