Skip to content

Commit

Permalink
refactor: bump github.com/gofrs/uuid to current major version (#118)
Browse files Browse the repository at this point in the history
* refactor: bump github.com/gofrs/uuid to current major version

* test: guard access to units with a lock

this should solve the race condition in CI
  • Loading branch information
kruskall committed Jul 11, 2024
1 parent 94f1105 commit 136cff6
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion dev-tools/v2tool/server/tool.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
"github.com/elastic/elastic-agent-client/v7/pkg/client/mock"
"github.com/elastic/elastic-agent-client/v7/pkg/proto"
"github.com/elastic/elastic-agent-libs/logp"
"github.com/gofrs/uuid"
"github.com/gofrs/uuid/v5"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials"
protobuf "google.golang.org/protobuf/proto"
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ go 1.21

require (
github.com/elastic/elastic-agent-libs v0.7.2
github.com/gofrs/uuid v4.4.0+incompatible
github.com/gofrs/uuid/v5 v5.2.0
github.com/golang/protobuf v1.5.3
github.com/google/go-cmp v0.5.9
github.com/google/pprof v0.0.0-20230426061923-93006964c1fc
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/elastic/elastic-agent-libs v0.7.2 h1:yT0hF0UAxJCdQqhHh6SFpgYrcpB10oFzPj8IaytPS2o=
github.com/elastic/elastic-agent-libs v0.7.2/go.mod h1:pVBEElQJUO9mr4WStWNXuQGsJn54lcjAoYAHmsvBLBc=
github.com/gofrs/uuid v4.4.0+incompatible h1:3qXRTX8/NbyulANqlc0lchS1gqAVxRgsuW1YrTJupqA=
github.com/gofrs/uuid v4.4.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM=
github.com/gofrs/uuid/v5 v5.2.0 h1:qw1GMx6/y8vhVsx626ImfKMuS5CvJmhIKKtuyvfajMM=
github.com/gofrs/uuid/v5 v5.2.0/go.mod h1:CDOjlDMVAtN56jqyRUZh58JT31Tiw7/oQyEXZV+9bD8=
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg=
github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
Expand Down
2 changes: 2 additions & 0 deletions pkg/client/client_v2_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -554,6 +554,8 @@ func testClientV2CheckinUnitState(t *testing.T, localRPC string) {

assert.Equal(t, wantFQDN, gotFQDN)
assert.Equal(t, gotTriggers&TriggeredFeatureChange, TriggeredFeatureChange)
m.Lock()
defer m.Unlock()
assert.Equal(t, UnitStateHealthy, unitOne.state)
assert.Equal(t, "Healthy", unitOne.stateMsg)
assert.Equal(t, UnitStateStopped, unitTwo.state)
Expand Down
2 changes: 1 addition & 1 deletion pkg/client/mock/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

package mock

import "github.com/gofrs/uuid"
import "github.com/gofrs/uuid/v5"

// NewID is a small wrapper that returns a UUID used for agent client IDs
func NewID() string {
Expand Down
2 changes: 1 addition & 1 deletion pkg/client/mock/stub_serverV1.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"sync"

"github.com/elastic/elastic-agent-client/v7/pkg/proto"
"github.com/gofrs/uuid"
"github.com/gofrs/uuid/v5"
"google.golang.org/grpc"
)

Expand Down
2 changes: 1 addition & 1 deletion pkg/client/mock/stub_serverV2.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (
"runtime"
"sync"

"github.com/gofrs/uuid"
"github.com/gofrs/uuid/v5"
"google.golang.org/grpc"

"github.com/elastic/elastic-agent-client/v7/pkg/client/chunk"
Expand Down

0 comments on commit 136cff6

Please sign in to comment.