-
Notifications
You must be signed in to change notification settings - Fork 42
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
[nexus] Check that representative collection populates "inv_..." tables #6637
Conversation
|
||
async fn check_all_inv_tables(datastore: &DataStore, status: AllInvTables) { |
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.
Nit - maybe
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?
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.
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.
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.
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
Tested this manually by removing
datasets
andzpools
from the representative collection and observing these tests fail with clear errors mentioning those tables explicitly.Fixes #5305
Fixes #6636