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

Functional Test Runner, test/functional/test_runner.py, intermittently fails on random functional tests. #95

Closed
gto90 opened this issue Jun 21, 2022 · 4 comments
Assignees
Labels
bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed

Comments

@gto90
Copy link
Member

gto90 commented Jun 21, 2022

Describe the issue

When executing the functional test suite via test/functional/test_runner.py --extended, some tests will intermittently fail. However, when running each test in isolation, they will all pass save for test/functional/zmq_test.py which there is another raised issue for..

It does not matter how many threads the test runner is configured to run (e.g. >= 1); all configurations will result in random functional test failures.

What behavior did you expect?

The expected behavior is that regardless of the number of threads the test runner is configured with, all functional tests will pass.

What was the actual behavior (provide screenshots if the issue is GUI-related)?

The actual behavior is that some functional tests will fail intermittently, regardless of the number of threads the test runner is configured with. See here.

How reliably can you reproduce the issue, what are the steps to do so?

This issue can be reproduced on a local machine and via GitHub Actions.

What version of DigiByte Core are you using, where did you get it (website, self-compiled, etc)?

v8.22

What type of machine are you observing the error on (OS/CPU and disk type)?

All machine types can reproduce this issue, but Mac OS 10.15, 11 and 12 were used locally. GitHub Actions with Ubuntu latest were also used.

@gto90 gto90 added bug Something isn't working help wanted Extra attention is needed good first issue Good for newcomers labels Jun 21, 2022
@JaredTate
Copy link

It appears this can be fixed by adding a simple "--timeout-factor=" argument when running test_runner.py.
Ex:

test/functional/test_runner.py --jobs=10 --timeout-factor=1.4

It seems BTC devs ran into similar issues with random failures with functional tests. bitcoin/bitcoin#20183

In readme:
https://github.com/DigiByte-Core/digibyte/blob/feature/8.22.0/test/README.md

Often while debugging rpc calls from functional tests, the test might reach timeout before process can return a response. Use --timeout-factor 0 to disable all rpc timeouts for that particular functional test. Ex: test/functional/wallet_hd.py --timeout-factor 0.

In code:
https://github.com/DigiByte-Core/digibyte/blob/feature/8.22.0/test/functional/test_framework/test_framework.py#L194

        parser.add_argument('--timeout-factor', dest="timeout_factor", type=float, default=1.0, help='adjust test timeouts by a factor. Setting it to 0 disables all timeouts')

@JaredTate
Copy link

Boom! All functional tests pass for me with --timeout-factor=3. Have run it twice now. I think we can close this, you will have to play with it depending on your local dev environment. For me running a Mac with 8 cores and doing other work 3 jobs was the sweet spot.

test/functional/test_runner.py --jobs=3 --timeout-factor=3

@gto90
Copy link
Member Author

gto90 commented Jul 12, 2022

Great work on this @JaredTate ! Did you try these params on the GitHub action runners or do we still need to open a PR for that?

gto90 added a commit that referenced this issue Jul 16, 2022
Resolved the random functional test failures by applying the fix outlined in Issue #95

Signed-off-by: GTO90 <[email protected]>
@gto90
Copy link
Member Author

gto90 commented Mar 15, 2023

This issue has been resolved by #106

@gto90 gto90 closed this as completed Mar 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

6 participants