Skip to content

Commit d2249b8

Browse files
jannikluhnulope
authored andcommitted
Fix TestStartNetworkNodeIntegration
The test TestStartNetworkNodeIntegration was failing due to a detected race condition. The race condition was due to a write and read on the package-level `version` variable in shversion. To fix it, we stop caching the version. This should not have a performance impact because the version is expected to be accessed only once.
1 parent 6f25a13 commit d2249b8

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

rolling-shutter/cmd/shversion/shversion.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,15 @@ func VersionShort() string {
2424
if version == "" {
2525
info, ok := debug.ReadBuildInfo()
2626
if ok {
27-
version = info.Main.Version
28-
if version == "(devel)" {
27+
versionShort := info.Main.Version
28+
if versionShort == "(devel)" {
2929
for _, s := range info.Settings {
3030
if s.Key == "vcs.revision" {
31-
version = fmt.Sprintf("(devel-%s)", s.Value)
32-
break
31+
return fmt.Sprintf("(devel-%s)", s.Value)
3332
}
3433
}
3534
}
35+
return versionShort
3636
}
3737
}
3838
return version

0 commit comments

Comments
 (0)