Skip to content

Commit

Permalink
invoke m.Run on TestMain and reduce test flakiness (#41891) (#41908)
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.

(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 5531728 commit 2ad17aa
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 2ad17aa

Please sign in to comment.