[nexus] Check that representative collection populates "inv_..." tables#6637
Merged
Conversation
jgallagher
approved these changes
Sep 23, 2024
| ArePopulated, | ||
| } | ||
|
|
||
| async fn check_all_inv_tables(datastore: &DataStore, status: AllInvTables) { |
Contributor
There was a problem hiding this comment.
Nit - maybe
Suggested change
| async fn check_all_inv_tables(datastore: &DataStore, status: AllInvTables) { | |
| #[track_caller] | |
| async fn check_all_inv_tables(datastore: &DataStore, status: AllInvTables) { |
so assertion failures get attached to the tests that call this helper?
Collaborator
Author
There was a problem hiding this comment.
mmm gave this a shot, turns out it doesn't really like being attached to async functions.
warning: `#[track_caller]` on async functions is a no-op
I'll do the work to plumb an anyhow::Error out of here, with context.
Collaborator
Author
There was a problem hiding this comment.
With the new result-based version, I can see this error when I intentionally omit a zpool from the representative collection:
--- STDERR: nexus-db-queries db::datastore::inventory::test::test_inventory_deletion ---
log file: /tmp/nexus_db_queries-391529f8ced893bc-inventory_deletion.3760136.0.log
note: configured to log to "/tmp/nexus_db_queries-391529f8ced893bc-inventory_deletion.3760136.0.log"
thread 'db::datastore::inventory::test::test_inventory_deletion' panicked at nexus/db-queries/src/db/datastore/inventory.rs:2887:14:
All inv_... tables should be populated by representative collection: Found table without entries: inv_zpool
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Tested this manually by removing
datasetsandzpoolsfrom the representative collection and observing these tests fail with clear errors mentioning those tables explicitly.Fixes #5305
Fixes #6636