-
Notifications
You must be signed in to change notification settings - Fork 38.7k
tests: Run functional test on Windows and enable it on Appveyor #14007
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
Conversation
|
I think there is some interference with a firewall or something that kills the bitcoind processes? |
appveyor.yml
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could as a first step only run the util tests?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You mean to drop away functional tests and replace it with util tests from this PR, and re-add the funfctional tests in another PR?
Note to reviewers: This pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first. |
I agree with you, they are all passed on my Windows PC. |
|
They didn't pass for me on Windows 7 |
|
Oh, it's occasionally. I tested to run it 10 times, 8 times failed, 2 times succeed. |
|
This is ready for review, the wallet_multiwallet.py fail is unrelated to the test framework. It is a bug related to c++ code, it would exit with 0xC0000005(Acccess violation) during shutdown occasionally. |
test/util/bitcoin-util-test.py
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this change needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The binary built by MSVC is not at src/, so it needs a variable to indicate the binary location.
appveyor.yml
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this caching fix can be submitted in an independent pr
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fine
|
I think we could disable those problematic tests for now. |
Solve this problem by using new connection every time we call RPC. Not sure why would that happen. |
|
What happened to the cache fix? I think we are not yet properly caching the intermediate compile results? |
|
@MarcoFalke I add the build cache in #14086 |
|
#14086 has been merged, this is ready for review. |
test/functional/combine_logs.py
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this check can be removed. Color is off by default and if someone specifies color, they have a reason to do so (maybe write to a file that is read on a different os/platform)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is no longer supported? So could remove the named arg "connection"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could move this into a method def _set_conn(self): to avoid duplication?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, any rationale for this? I'd prefer to throw if the log was not unicode.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
an error message thrown by boost is always localized(translated) and use ANSI encoding, so it would always throw an error. I don't know any solution to fix this. There is no way to specify the error message format.
For now, I could revert this because appveyor is using English, but it would cause problem if the user is running a non-English Windows. It can be marked as an issue with #13869.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in #14192
test/functional/test_runner.py
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd prefer to keep the throw on non-unicode log files.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above.
appveyor.yml
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I want to avoid re-uploading cache files if there is no change in #14086, I chose to delete the stats file entirely. But that was a mistake, it would also clear the cache size information which extremely increase cache size.
After then, I realize that clcache has a command to clear hit and miss info but retain size info: clcache -z
|
@NicolasDorier @sipsorcery Would you mind reviewing this? |
|
tACK 1223343 |
|
ran several time, do not pass. Though it is not blocking for me, can as well reactivate the test once the fix is done later down the road. tACK 529c5274de6fae782154c2845b6a691db46b0d4e |
|
Thanks for your review 👍 |
test/util/bitcoin-util-test.py
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, this env var is not documented and makes the code a bit harder to read. Would it be too ugly to call mkdir src && mv ./bitcoin*.exe ./src in the appveyor after compile?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about now?
|
Thanks, re-ACK |
|
@jnewbery Would you mind reviewing the test changes here. Most of code that changed in this PR are previously written by you. |
|
Sure, I can review the tests: Make it possible to run functional tests on Windows commit, but it probably won't be until next week. |
test/functional/test_runner.py
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if you have to use ctypes directly here, with magic numbers, can you please at least add a comment about what the numbers here mean, what it is doing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess this is meant as a temporary work-around until we find out why? (might want to add a comment in that regard) being able to re-use RPC connections is a big deal, it's not something we should simply accept as-is.
|
utACK d5678479266bb087b37ee503000ab161d9e44664 |
|
Update: Disabled 1 additional tests for now because of #14225 merged.
|
|
@MarcoFalke |
|
utACK 661ac15 |
…Appveyor 661ac15 appveyor: Run functional tests on appveyor (Chun Kuan Lee) 2148c36 tests: Make it possible to run functional tests on Windows (Chun Kuan Lee) Pull request description: This PR do the following things: - Make functional tests compatible with Windows - Print color output in functional tests for Windows 10 - Run util and functional tests on appveyor - Do not run symlink tests on Windows Note: - The wallet_multiwallet.py fail is unrelated to the test framework, it's a bug related to c++ code or maybe dependencies. `bitcoind` would exit with 0xC0000005(Access violation) during shutdown occasionally. Disable this for now. - Not using `--failfast` because this is still in experimental. We should track if there is any other error. - Disable ZMQ tests because the python zmq library could cause access violation sometimes. - Disable `feature_notifications` because Bitcoin Core handles the command in different thread, whicha can cause a race condition. Tree-SHA512: b76db137d264e62a5c130e1cbca7a2ca002a7a0f4153fa0b92c1ea6c9c09ef0533e11c49bdbd566c472d8ff59f245758feb5e5a6ec6cb6bb66a1c67bab5fa48a
jnewbery
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tested ACK. I think there's one change that needs to be reverted. @ken2812221 - can you take a look for me?
| # Remove the test cases that the user has explicitly asked to exclude. | ||
| if args.exclude: | ||
| exclude_tests = [re.sub("\.py$", "", test) + ".py" for test in args.exclude.split(',')] | ||
| exclude_tests = [re.sub("\.py$", "", test) + (".py" if ".py" not in test else "") for test in args.exclude.split(',')] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand this change. The point of:
[re.sub("\.py$", "", test) + ".py"
is that if <test_name>.py or <test_name> is given, then it's normalized to <test_name>.py.
Your new version:
re.sub("\.py$", "", test) + (".py" if ".py" not in test else "")
essentially toggles, so <test_name>.py is changed to <test_name> and <test_name> is changed to <test_name>.py.
>>> test1 = 'test_name1.py'
>>> test2 = 'test_name2'
>>> for test in [test1,test2]:
... print(re.sub("\.py$", "", test) + ".py") # original version
...
test_name1.py
test_name2.py
>>> for test in [test1,test2]:
... print(re.sub("\.py$", "", test) + (".py" if ".py" not in test else "")) # new version
...
test_name1
test_name2.py
This breaks using -exclude=<test_name>.py
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The goal was to be able to specify --exclude "feature_notifications,wallet_multiwallet,wallet_multiwallet.py --usecli".
I think removing everything from the test_list that .startswith(item.split('.py')[0]) for any item in args.exclude.split(',') should solve all issues?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I didn't test that case. Should be fixed in #14316
…ers in `--exclude` list c7b3e48 tests: exclude all tests with difference parameters (Chun Kuan Lee) Pull request description: Fix broken exclusion list in functional tests. See bitcoin#14007 (review) Tree-SHA512: b6c2b86fef13e3c00c695adaeeb3e47ee9b48877c71bc605d24201ce931b2ef3ae9f5f199071fa1ec5de2d7aadc478410094c380cc297922e683e9b2569cda03
Summary: Backport of core [[bitcoin/bitcoin#14007 | PR14007]]. Depends on D5958. Test Plan: ninja check-functional The output should be all green. Not blue. Build for windows, then: - Install python if needed and add it to your path - If you copy the project to some place, you need at least the `src`, `test`, `share` and your build directories. - Copy the test_runner.py to the build directory to replace the symlink - Update the config.ini file to match you paths Then in a powershell: $env:PYTHONIOENCODING="utf-8" python .\test\functional\test_runner.py --force Most of the tests should pass, but still far from all. More backports coming. Reviewers: #bitcoin_abc, deadalnix Reviewed By: #bitcoin_abc, deadalnix Differential Revision: https://reviews.bitcoinabc.org/D5964

This PR do the following things:
Note:
bitcoindwould exit with 0xC0000005(Access violation) during shutdown occasionally. Disable this for now.--failfastbecause this is still in experimental. We should track if there is any other error.feature_notificationsbecause Bitcoin Core handles the command in different thread, whicha can cause a race condition.