-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Fix race condition when running tests for pkg/skaffold/instrumentation #5267
Fix race condition when running tests for pkg/skaffold/instrumentation #5267
Conversation
@@ -33,6 +33,7 @@ type ExitCoder interface { | |||
} | |||
|
|||
func main() { | |||
instrumentation.SetOnlineStatus() |
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.
IMHO we should be pinging a server when the user has disable telemetry.
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 function checks if the user has metrics collection enabled and pings/doesn't ping based off of that. This is done by checking the value of the shouldExportMetrics
package variable
Codecov Report
@@ Coverage Diff @@
## master #5267 +/- ##
==========================================
- Coverage 71.90% 71.87% -0.04%
==========================================
Files 388 388
Lines 14063 14064 +1
==========================================
- Hits 10112 10108 -4
- Misses 3210 3214 +4
- Partials 741 742 +1
Continue to review full report at Codecov.
|
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!
Description
Fixes a race condition that can occur when running tests for pkg/skaffold/instrumentation. To fix the issue of two threads accessing the
isOnline
variable, I've moved the responsibility of checking if the user is online to a new function and am calling that in skaffold'smain()