Skip to content

Commit

Permalink
[8.16](backport #41891) Invoke m.Run on TestMain and reduce test flak…
Browse files Browse the repository at this point in the history
…iness (#41906)

* invoke m.Run on TestMain and reduce test flakiness (#41891)

Some TestMain were not running any tests as they did not invoke m.Run. This change fixes that.

Also other tests were presenting some flakyness, therefore this change also attempts to fix the flakiness by setting really unique IDs for filestream tests and increasing a timeout for TestTranslateGUIDWithLDAP.

(cherry picked from commit 83251ea)

---------

Co-authored-by: Anderson Queiroz <anderson.queiroz@elastic.co>
  • Loading branch information
mergify[bot] and AndersonQ authored Dec 6, 2024
1 parent 8c7d219 commit ea2800b
Show file tree
Hide file tree
Showing 5 changed files with 109 additions and 72 deletions.
5 changes: 4 additions & 1 deletion filebeat/autodiscover/builder/hints/logs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
package hints

import (
"os"
"path/filepath"
"testing"

Expand All @@ -30,8 +31,10 @@ import (
"github.com/elastic/elastic-agent-libs/paths"
)

func TestMain(t *testing.M) {
func TestMain(m *testing.M) {
InitializeModule()

os.Exit(m.Run())
}

func TestGenerateHints(t *testing.T) {
Expand Down
Loading

0 comments on commit ea2800b

Please sign in to comment.