-
Notifications
You must be signed in to change notification settings - Fork 1.5k
chore(bigtable): debug test timeouts #13494
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
DO NOT SUBMIT this is just trying to evaluate timings
Summary of ChangesHello @shollyman, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request is a diagnostic change aimed at understanding and debugging test timeouts within the Bigtable integration environment setup. It introduces precise timing measurements around the initialization of both production and emulated Bigtable environments, logging these durations to identify potential bottlenecks. This change is explicitly marked as a temporary measure for evaluation and is not intended for submission. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
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.
Code Review
This pull request adds timing logs to debug test timeouts. While this is intended for debugging, there's an opportunity to refactor the new logic to avoid code duplication, making it cleaner and more maintainable, even for temporary code.
| if integrationConfig.UseProd { | ||
| if c.Table == "" { | ||
| c.Table = fmt.Sprintf("it-table-%d", time.Now().Unix()) | ||
| } | ||
| return NewProdEnv(*c) | ||
| penv, err := NewProdEnv(*c) | ||
| log.Infof("NewProdEnv: %s", time.Since(start)) | ||
| return penv, err | ||
| } | ||
| return NewEmulatedEnv(*c) | ||
| emenv, err := NewEmulatedEnv(*c) | ||
| log.Infof("NewEmulatedEnv: %s", time.Since(start)) | ||
| return emenv, err |
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.
To avoid repeating the logging and return logic, you could refactor this block. By using an if/else structure to determine which environment to create and then logging and returning once at the end, the code becomes more concise and easier to maintain.
var env IntegrationEnv
var err error
var name string
if integrationConfig.UseProd {
if c.Table == "" {
c.Table = fmt.Sprintf("it-table-%d", time.Now().Unix())
}
env, err = NewProdEnv(*c)
name = "NewProdEnv"
} else {
env, err = NewEmulatedEnv(*c)
name = "NewEmulatedEnv"
}
log.Infof("%s: %s", name, time.Since(start))
return env, err
DO NOT SUBMIT this is just trying to evaluate timings