Skip to content

Commit 2cd8b2c

Browse files
[8.18](backport #46414) [Flaky test] metricbeat modules: increase integration test timeout to 2h (#46419)
* devtools: add GoTestArgs.Timeout and set module timeout to 2h (#46414) The metricbeat module timeout build the docker image during the tests. For the kafka module, we use `docker.elastic.co/integrations-ci/beats-kafka` which downloads kafka during the image build process. It might take some time, much more than the default 10 min test timeout. This change introduces a test timeout property to `GoTestArgs` and set it to 2h for the metricbeat module tests. (cherry picked from commit c7a84ee) # Conflicts: # dev-tools/mage/gotest.go --------- Co-authored-by: Anderson Queiroz <[email protected]>
1 parent 27424ca commit 2cd8b2c

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

dev-tools/mage/gotest.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ type GoTestArgs struct {
5151
JUnitReportFile string // File to write a JUnit XML test report to.
5252
CoverageProfileFile string // Test coverage profile file (enables -cover).
5353
Output io.Writer // Write stderr and stdout to Output if set
54+
Timeout string // Timeout for tests (-timeout flag)
5455
}
5556

5657
// TestBinaryArgs are the arguments used when building binary for testing.
@@ -176,6 +177,10 @@ func GoTestIntegrationArgsForPackage(pkg string) GoTestArgs {
176177
args := makeGoTestArgsForPackage("Integration", pkg)
177178

178179
args.Tags = append(args.Tags, "integration")
180+
// some test build docker images which download artifacts, and it can take a
181+
// long time.
182+
args.Timeout = "2h"
183+
179184
return args
180185
}
181186

@@ -345,6 +350,9 @@ func GoTest(ctx context.Context, params GoTestArgs) error {
345350
"-coverprofile="+params.CoverageProfileFile,
346351
)
347352
}
353+
if params.Timeout != "" {
354+
testArgs = append(testArgs, "-timeout="+params.Timeout)
355+
}
348356
testArgs = append(testArgs, params.ExtraFlags...)
349357
testArgs = append(testArgs, params.Packages...)
350358

0 commit comments

Comments
 (0)