diff --git a/test/kitchen/test/integration/security-agent-test/rspec_datadog/security-agent-test_spec.rb b/test/kitchen/test/integration/security-agent-test/rspec_datadog/security-agent-test_spec.rb index d8d621404b5ed..729aab70216dd 100644 --- a/test/kitchen/test/integration/security-agent-test/rspec_datadog/security-agent-test_spec.rb +++ b/test/kitchen/test/integration/security-agent-test/rspec_datadog/security-agent-test_spec.rb @@ -59,11 +59,16 @@ def check_output(output, wait_thr, tag="") # The package name has to be the real path in order to use agent-platform's CODEOWNER parsing downstream # The junitfiles are uploaded to the Datadog CI Visibility product, and for downloading # The json files are used to print failed tests at the end of the Gitlab job + # + # The tests are retried if they fail, but only if less than 5 failed + # so that we do not retry the whole testsuite in case of a global failure gotestsum_test2json_cmd = ["sudo", "-E", "/go/bin/gotestsum", "--format", "testname", "--junitfile", xmlpath, "--jsonfile", jsonpath, + "--rerun-fails=2", + "--rerun-fails-max-failures=5", "--raw-command", "--", "/go/bin/test2json", "-t", "-p", "github.com/DataDog/datadog-agent/pkg/security/tests" ]