Skip to content

Commit 44bd74f

Browse files
renovate[bot]antoninbas
authored andcommitted
fix(deps): update module github.com/stretchr/testify to v1.11.1 (main) (antrea-io#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 a7012e6 commit 44bd74f

4 files changed

Lines changed: 25 additions & 15 deletions

File tree

go.mod

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,10 @@ require (
4848
github.com/prometheus/client_golang v1.20.5
4949
github.com/prometheus/common v0.62.0
5050
github.com/sirupsen/logrus v1.9.3
51-
github.com/spf13/afero v1.14.0
52-
github.com/spf13/cobra v1.9.1
53-
github.com/spf13/pflag v1.0.6
54-
github.com/stretchr/testify v1.10.0
51+
github.com/spf13/afero v1.15.0
52+
github.com/spf13/cobra v1.10.1
53+
github.com/spf13/pflag v1.0.10
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: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -712,25 +712,26 @@ github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasO
712712
github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ=
713713
github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk=
714714
github.com/spf13/afero v1.4.1/go.mod h1:Ai8FlHk4v/PARR026UzYexafAt9roJ7LcLMAmO6Z93I=
715-
github.com/spf13/afero v1.14.0 h1:9tH6MapGnn/j0eb0yIXiLjERO8RB6xIVZRDCX7PtqWA=
716-
github.com/spf13/afero v1.14.0/go.mod h1:acJQ8t0ohCGuMN3O+Pv0V0hgMxNYDlvdk+VTfyZmbYo=
715+
github.com/spf13/afero v1.15.0 h1:b/YBCLWAJdFWJTN9cLhiXXcD7mzKn9Dm86dNnfyQw1I=
716+
github.com/spf13/afero v1.15.0/go.mod h1:NC2ByUVxtQs4b3sIUphxK0NioZnmxgyCrfzeuq8lxMg=
717717
github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE=
718718
github.com/spf13/cast v1.5.1 h1:R+kOtfhWQE6TVQzY+4D7wJLBgkdVasCEFxSUBYBYIlA=
719719
github.com/spf13/cast v1.5.1/go.mod h1:b9PdjNptOpzXr7Rq1q9gJML/2cdGQAo69NKzQ10KN48=
720720
github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ=
721721
github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU=
722722
github.com/spf13/cobra v1.0.0/go.mod h1:/6GTrnGXV9HjY+aR4k0oJ5tcvakLuG6EuKReYlHNrgE=
723-
github.com/spf13/cobra v1.9.1 h1:CXSaggrXdbHK9CF+8ywj8Amf7PBRmPCOJugH954Nnlo=
724-
github.com/spf13/cobra v1.9.1/go.mod h1:nDyEzZ8ogv936Cinf6g1RU9MRY64Ir93oCnqb9wxYW0=
723+
github.com/spf13/cobra v1.10.1 h1:lJeBwCfmrnXthfAupyUTzJ/J4Nc1RsHC/mSRU2dll/s=
724+
github.com/spf13/cobra v1.10.1/go.mod h1:7SmJGaTHFVBY0jW4NXGluQoLvhqFQM+6XSKD+P4XaB0=
725725
github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo=
726726
github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk=
727727
github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo=
728728
github.com/spf13/pflag v0.0.0-20170130214245-9ff6c6923cff/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
729729
github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
730730
github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
731731
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
732-
github.com/spf13/pflag v1.0.6 h1:jFzHGLGAlb3ruxLB8MhbI6A8+AQX/2eW4qeyNZXNp2o=
733-
github.com/spf13/pflag v1.0.6/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
732+
github.com/spf13/pflag v1.0.9/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
733+
github.com/spf13/pflag v1.0.10 h1:4EBh2KAYBwaONj6b2Ye1GiHfwjqyROoF4RwYO+vPwFk=
734+
github.com/spf13/pflag v1.0.10/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
734735
github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s=
735736
github.com/spf13/viper v1.4.0/go.mod h1:PTJ7Z/lr49W6bUbkmS1V3by4uWynFiR9p7+dSq/yZzE=
736737
github.com/spf13/viper v1.16.0 h1:rGGH0XDZhdUOryiDWjmIvUSWpbNqisK8Wk0Vyefw8hc=
@@ -754,8 +755,8 @@ github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO
754755
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
755756
github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
756757
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
757-
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
758-
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
758+
github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=
759+
github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=
759760
github.com/subosito/gotenv v1.4.2 h1:X1TuBLAMDFbaTAChgCBLu3DU3UPyELpnF2jjJ2cz/S8=
760761
github.com/subosito/gotenv v1.4.2/go.mod h1:ayKnFf/c6rvx/2iiLrJUk1e6plDbT3edrFNGqEflhK0=
761762
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)