Correct sampling interval values#5192
Correct sampling interval values#5192priyaranjannanda wants to merge 1 commit intoopenconfig:mainfrom
Conversation
Summary of ChangesHello, 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 refactors the handling of the Highlights
Changelog
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.
Code Review
My main feedback is to adjust the scope of the samplingInterval variable to ensure that each subtest for a port runs independently without being affected by the state of the previous one. This will improve test robustness and prevent potential flakes.
| samplingInterval := 10 * time.Second | ||
| for _, port := range []string{"port1", "port2"} { | ||
| t.Run(fmt.Sprintf("Port:%s", port), func(t *testing.T) { |
There was a problem hiding this comment.
To ensure that each port's subtest runs with a clean state and is not affected by the previous run, the samplingInterval variable should be initialized within the scope of the t.Run block. Currently, it's defined outside the loop and modified within each subtest, which means the value from the port1 test will carry over to the port2 test. This could lead to unexpected behavior if the sampling intervals differ between ports.
| samplingInterval := 10 * time.Second | |
| for _, port := range []string{"port1", "port2"} { | |
| t.Run(fmt.Sprintf("Port:%s", port), func(t *testing.T) { | |
| for _, port := range []string{"port1", "port2"} { | |
| t.Run(fmt.Sprintf("Port:%s", port), func(t *testing.T) { | |
| samplingInterval := 10 * time.Second |
Changes for