-
Notifications
You must be signed in to change notification settings - Fork 408
Make BenchmarkDrivers work again #9706
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
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.
Pull Request Overview
This PR fixes two critical issues that prevented the BenchmarkDrivers benchmark from working:
- Removes the
UnregisterAllDriversfunction which broke subsequent tests by clearing the global driver registry - Adds unwrapping logic for
StoreMetricsWrapperin the cleanup function to enable proper type assertion to*dynamodb.Store
Key Changes
- Replaced
UnregisterAllDrivers()with a filtering approach that removes preloaded drivers from the test comparison - Added unwrapping logic to handle
StoreMetricsWrapperbefore callingDropTable() - Added missing
dynamodbimport for driver registration
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| pkg/kv/store.go | Removes the problematic UnregisterAllDrivers function |
| pkg/kv/store_test.go | Updates TestDrivers to filter preloaded drivers instead of unregistering all drivers |
| pkg/testutil/dynamodb.go | Adds unwrapping logic to handle StoreMetricsWrapper before calling DropTable() |
| pkg/kv/msg_test.go | Adds missing dynamodb import for driver registration |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
pkg/testutil/dynamodb.go
Outdated
| } | ||
| err = store.(*dynamodb.Store).DropTable() | ||
| if err != nil { | ||
| tb.Fatalf("failed to delete table from DB %v %s", table, err) |
Copilot
AI
Nov 20, 2025
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 variable table is undefined. This should be testParams.TableName to properly reference the table name in the error message.
| tb.Fatalf("failed to delete table from DB %v %s", table, err) | |
| tb.Fatalf("failed to delete table from DB %v %s", testParams.TableName, err) |
- Remove UnregisterAllDrivers - it breaks all tests after it. - Unwrap StoreMetricsWrapper in GetDynamoDBProd cleanup - it breaks any use.
5ac3347 to
f13fa77
Compare
Found by Copilot, for the wrong reason.
AliRamberg
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.
It looks good to ME
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.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
nopcoder
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.
lgtm
arielshaqed
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.
THANKS!
Reviewer please note
This is not particularly urgent; I mostly want to start collecting interesting benchmark values, and this is a good testbed. OTOH, we should not have broken code - and this benchmark was broken in two different ways.