Skip to content

Conversation

@arielshaqed
Copy link
Contributor

  • Remove UnregisterAllDrivers - it breaks all tests after it.
  • Unwrap StoreMetricsWrapper in GetDynamoDBProd cleanup - it breaks any use.

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.

@arielshaqed arielshaqed requested review from a team and Copilot November 20, 2025 17:56
@arielshaqed arielshaqed added bug Something isn't working pr/merge-if-approved Reviewer: please feel free to merge if no major comments performance exclude-changelog PR description should not be included in next release changelog minor-change Used for PRs that don't require issue attached labels Nov 20, 2025
Copilot finished reviewing on behalf of arielshaqed November 20, 2025 17:58
Copy link
Contributor

Copilot AI left a 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 UnregisterAllDrivers function which broke subsequent tests by clearing the global driver registry
  • Adds unwrapping logic for StoreMetricsWrapper in 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 StoreMetricsWrapper before calling DropTable()
  • Added missing dynamodb import 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.

}
err = store.(*dynamodb.Store).DropTable()
if err != nil {
tb.Fatalf("failed to delete table from DB %v %s", table, err)
Copy link

Copilot AI Nov 20, 2025

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.

Suggested change
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)

Copilot uses AI. Check for mistakes.
- Remove UnregisterAllDrivers - it breaks all tests after it.
- Unwrap StoreMetricsWrapper in GetDynamoDBProd cleanup - it breaks any use.
@arielshaqed arielshaqed force-pushed the chore/restore-kv-bench branch from 5ac3347 to f13fa77 Compare November 23, 2025 09:38
Found by Copilot, for the wrong reason.
Copy link
Contributor

@AliRamberg AliRamberg left a 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

Copy link
Contributor

Copilot AI left a 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.

Copy link
Contributor

@nopcoder nopcoder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Copy link
Contributor Author

@arielshaqed arielshaqed left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

THANKS!

@arielshaqed arielshaqed merged commit 8232830 into master Nov 23, 2025
46 checks passed
@arielshaqed arielshaqed deleted the chore/restore-kv-bench branch November 23, 2025 10:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working exclude-changelog PR description should not be included in next release changelog minor-change Used for PRs that don't require issue attached performance pr/merge-if-approved Reviewer: please feel free to merge if no major comments

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants