Skip to content

Commit 03ee04e

Browse files
L3n41cguyarb
andauthored
Revert "Revert "[ACIX-835] Update testify to v1.11.1" (#42017)" (#42020)
This reverts commit aa9e94f. ### What does this PR do? Re-apply #41981 and fix the tests that it broke. ### Motivation Same as #41981: speed up tests execution thanks to stretchr/testify#1427 that makes `require.EventuallyWithT` test the condition immediately instead of waiting for an initial delay before making the very first try. ### Describe how you validated your changes Launched a [full pipeline](https://gitlab.ddbuild.io/DataDog/datadog-agent/-/pipelines/79481153) to be sure to run all the tests and not a subset of them: #42020 (comment) ### Additional Notes The main feature we were looking for by upgrading `testify` to `v1.11.1` was the fact that that `require.EventuallyWithT` is now evaluating the condition the first time immediately instead of waiting for a `tick` delay before making the first try. This unexpectedly broke the tests that are touched in this PR. Fixing tests by adding a `time.Sleep(…)` is most probably not the smartest way of fixing them. But it restores the execution time flow of the previous versions of `testify` that happened to make the tests pass. Co-authored-by: guyarb <[email protected]>
1 parent 17c8a04 commit 03ee04e

File tree

3 files changed

+11
-5
lines changed

3 files changed

+11
-5
lines changed

comp/otelcol/otlp/components/exporter/serializerexporter/go.mod

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -217,9 +217,6 @@ require (
217217
gopkg.in/yaml.v3 v3.0.1 // indirect
218218
)
219219

220-
// Pin github.com/stretchr/testify to v1.10.0 while waiting for https://github.com/DataDog/datadog-agent/pull/40182
221-
replace github.com/stretchr/testify => github.com/stretchr/testify v1.10.0
222-
223220
// This section was automatically added by 'dda inv modules.add-all-replace' command, do not edit manually
224221

225222
replace (

comp/otelcol/otlp/components/exporter/serializerexporter/go.sum

Lines changed: 9 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/network/tracer/tracer_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1173,6 +1173,7 @@ func (s *TracerSuite) TestTCPEstablished() {
11731173
c.Close()
11741174

11751175
// Wait for the connection to be sent from the perf buffer
1176+
time.Sleep(100 * time.Millisecond)
11761177
require.EventuallyWithT(t, func(collect *assert.CollectT) {
11771178
var ok bool
11781179
connections, cleanup := getConnections(collect, tr)
@@ -1210,6 +1211,7 @@ func (s *TracerSuite) TestTCPEstablishedPreExistingConn() {
12101211
c.Close()
12111212

12121213
// Wait for the connection to be sent from the perf buffer
1214+
time.Sleep(100 * time.Millisecond)
12131215
var conn *network.ConnectionStats
12141216
require.EventuallyWithT(t, func(collect *assert.CollectT) {
12151217
var ok bool

0 commit comments

Comments
 (0)