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

Two tests in rpc_wallet_tests halt the test suite on Windows #3653

Closed
charlieok opened this issue Oct 31, 2018 · 0 comments
Closed

Two tests in rpc_wallet_tests halt the test suite on Windows #3653

charlieok opened this issue Oct 31, 2018 · 0 comments

Comments

@charlieok
Copy link
Contributor

charlieok commented Oct 31, 2018

Describe the issue

For these two tests:
rpc_wallet_tests/rpc_wallet_encrypted_wallet_zkeys
rpc_wallet_tests/rpc_wallet_encrypted_wallet_sapzkeys

The tests fail, and cause the test runner to halt.

Can you reliably reproduce the issue?

yes

If so, please list the steps to reproduce below:

  1. run a cross-compile on ubuntu to build windows executables
  2. copy ./src/test/test_bitcoin.exe to a windows machine
  3. download the zcash params ( https://github.com/zcash/zcash/blob/master/zcutil/fetch-params.sh#L11-L16 )
  4. move the params files to C:\Users\<windows_username>\AppData\Roaming\ZcashParams
  5. Run the tests:
test_bitcoin.exe --run_test=rpc_wallet_tests/rpc_wallet_encrypted_wallet_zkeys
test_bitcoin.exe --run_test=rpc_wallet_tests/rpc_wallet_encrypted_wallet_sapzkeys

Expected behaviour

The tests should pass

Actual behaviour + errors

After running one of these two tests, the runner fails with an error that looks like this:

This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.
terminate called after throwing an instance of 'boost::filesystem::filesystem_error'
  what():  boost::filesystem::remove: The process cannot access the file because it is being used by another process: "C:\Windows\TEMP\test_bitcoin_1540957381_88827"

Also, if test_bitcoin.exe is run with a group of tests (e.g. without the --run_test flag), it halts when it hits this error instead of running the rest of the tests.

The version of Zcash you were using:

2.0.1

Machine specs:

Windows 10

zkbot added a commit that referenced this issue Nov 1, 2018
Save and restore current_path in TestingSetup constructor/destructor

In issue #3653 , the affected tests change their current working directory to a temporary directory that is created in the TestingSetup constructor and deleted in the destructor. In Windows it seems to cause a problem when a process attempts to delete its current working directory.

This change fixes the issue by saving the path of the current working directory in the constructor, and restoring the working directory to that path in the destructor before deleting the temporary directory.
zkbot added a commit that referenced this issue Nov 2, 2018
Save and restore current_path in TestingSetup constructor/destructor

In issue #3653 , the affected tests change their current working directory to a temporary directory that is created in the TestingSetup constructor and deleted in the destructor. In Windows it seems to cause a problem when a process attempts to delete its current working directory.

This change fixes the issue by saving the path of the current working directory in the constructor, and restoring the working directory to that path in the destructor before deleting the temporary directory.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant