Skip to content

Commit

Permalink
invoke m.Run on TestMain and reduce test flakiness (#41891)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
AndersonQ authored Dec 5, 2024
1 parent 4e19d09 commit 83251ea
Show file tree
Hide file tree
Showing 6 changed files with 111 additions and 74 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 83251ea

Please sign in to comment.