10BC0 fix(deps): update module github.com/stretchr/testify to v1.11.1 (main… · antrea-io/antrea@03f9e58 · GitHub
[go: up one dir, main page]

Skip to content

Commit 03f9e58

Browse files
fix(deps): update module github.com/stretchr/testify to v1.11.1 (main) (#7448)
* fix(deps): update module github.com/stretchr/testify to v1.11.1 Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * Fix race conditions in unit tests The tests were not correct to begin with, and a change in the `assert.Eventually` implementation exposed the bug: stretchr/testify#1427 Signed-off-by: Antonin Bas <antonin.bas@broadcom.com> --------- Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Signed-off-by: Antonin Bas <antonin.bas@broadcom.com> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Antonin Bas <antonin.bas@broadcom.com>
1 parent f50efab commit 03f9e58

File tree

4 files changed

+15
-6
lines changed

4 files changed

+15
-6
lines changed

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ require (
5151
github.com/spf13/afero v1.15.0
5252
github.com/spf13/cobra v1.10.1
5353
github.com/spf13/pflag v1.0.10
54-
github.com/stretchr/testify v1.10.0
54+
github.com/stretchr/testify v1.11.1
5555
github.com/ti-mo/conntrack v0.5.2
5656
github.com/vishvananda/netlink v1.3.1
5757
github.com/vmware/go-ipfix v0.16.0

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -735,8 +735,8 @@ github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO
735735
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
736736
github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
737737
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
738-
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
739-
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
738+
github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=
739+
github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=
740740
github.com/subosito/gotenv v1.4.2 h1:X1TuBLAMDFbaTAChgCBLu3DU3UPyELpnF2jjJ2cz/S8=
741741
github.com/subosito/gotenv v1.4.2/go.mod h1:ayKnFf/c6rvx/2iiLrJUk1e6plDbT3edrFNGqEflhK0=
742742
github.com/ti-mo/conntrack v0.5.2 h1:PQ7MCdFjniEiTJT+qsAysREUsT5iH62/VNyhkB06HOI=

pkg/agent/ipassigner/linkmonitor/link_monitor_linux_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,8 @@ func Test_linkMonitor_listAndWatchLinks(t *testing.T) {
277277
for _, l := range tt.eventHandlers {
278278
assert.Equal(t, l.expectedLinkEvents, l.getReceivedLinkEvents())
279279
}
280+
d.mutex.RLock()
281+
defer d.mutex.RUnlock()
280282
assert.ElementsMatch(t, tt.expectedExistingLinks, d.linkNames.UnsortedList())
281283
},
282284
1*time.Second, 100*time.Millisecond, "timeout waiting for link events",

pkg/apiserver/registry/system/supportbundle/rest.go

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,11 @@ type supportBundleREST struct {
111111
mode string
112112
statusLocker sync.RWMutex
113113
cancelFunc context.CancelFunc
114-
cache *systemv1beta1.SupportBundle
114+
// cache stores the "current" or most recent SupportBundle resource. Because Get returns
115+
// this value directly, it is important for the supportBundleREST implementation *not* to
116+
// mutate fields in the SupportBundle object once it has been assigned to cache, in order to
117+
// ensure thread-safety. Otherwise, we would have a race with Get callers.
118+
cache *systemv1beta1.SupportBundle
115119

116120
ovsCtlClient ovsctl.OVSCtlClient
117121
aq agentquerier.AgentQuerier
@@ -154,8 +158,11 @@ func (r *supportBundleREST) Create(ctx context.Context, obj runtime.Object, _ re
154158
r.statusLocker.Lock()
155159
defer r.statusLocker.Unlock()
156160
if err != nil {
157-
klog.Errorf("Error when collecting supportBundle: %v", err)
158-
r.cache.Status = systemv1beta1.SupportBundleStatusNone
161+
klog.ErrorS(err, "Error when collecting supportBundle")
162+
r.cache = &systemv1beta1.SupportBundle{
163+
ObjectMeta: metav1.ObjectMeta{Name: r.mode},
164+
Status: systemv1beta1.SupportBundleStatusNone,
165+
}
159166
return
160167
}
161168
select {

0 commit comments

Comments
 (0)
0