-
Notifications
You must be signed in to change notification settings - Fork 113
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
Stop failing acceptance tests if their directories already exist #1588
Conversation
Also: * consistently create missing config and state directories * refactor the common config writing code into a separate function * only ignore NotFound errors in replace_config
Duplicated this branch into the zebra base repo and manually triggered the Test workflow on it: https://github.com/ZcashFoundation/zebra/actions/runs/484232685 |
Oops, this new code doesn't work, because it overwrites the configured state directory, adding a "state" directory to the provided path. I'll go rewrite the utility functions so we have a "just write the config and don't mess with it" function. |
We also had a testnet failure, that's not surprising, we'll fix that by deploying more testnet nodes. |
... and use it in the cached sapling acceptance tests. Enforce config immutability using the type system.
@@ -784,7 +826,7 @@ fn create_cached_database_height(network: Network, height: Height) -> Result<()> | |||
|
|||
let dir = PathBuf::from("/zebrad-cache"); | |||
let mut child = dir | |||
.with_config(config)? | |||
.with_exact_config(&config)? |
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.
@dconnolly @yaahc this is the actual fix, all the rest is refactoring and type system enforcement
.write_config_helper(config) | ||
} | ||
|
||
fn with_exact_config(self, config: &ZebradConfig) -> Result<Self> { |
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.
This is the new utility function, all the rest is refactoring and type system enforcement
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 and better documentation
@dconnolly can you do another manual run? |
Hmm yeah looks like testnet is a bit sad right now
|
Motivation
After PR #1560, the cached sapling tests started failing, because the acceptance test utility functions were too strict about existing directories.
Solution
Fixes:
Cleanup:
The code in this pull request has:
Review
@dconnolly knows the most about this code, so she should review it eventually.
This bug is causing failures on main, so it's pretty urgent, I hope @yaahc can do a quick review.
Related Issues
Makes it harder to test sync issues like #1586