Skip to content

Commit

Permalink
Fix TestNewModuleRegistry flakiness (#30453)
Browse files Browse the repository at this point in the history
Must sort filesets before comparing them, as they come from a map, so
the iteration order is random.

(cherry picked from commit 8ab92d8)

# Conflicts:
#	filebeat/fileset/modules_test.go
  • Loading branch information
adriansr authored and mergify-bot committed Feb 17, 2022
1 parent 8a15f89 commit 7c2af07
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions filebeat/fileset/modules_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import (
"errors"
"fmt"
"path/filepath"
"sort"
"testing"

"github.com/stretchr/testify/assert"
Expand Down Expand Up @@ -74,6 +75,12 @@ func TestNewModuleRegistry(t *testing.T) {
fs := filesets[fileset]
assert.NotNil(t, fs)
}
<<<<<<< HEAD
=======
sort.Strings(filesetList)
sort.Strings(expectedFilesets)
assert.Equal(t, filesetList, expectedFilesets)
>>>>>>> 8ab92d8e7d (Fix TestNewModuleRegistry flakiness (#30453))
}

for module, filesets := range reg.registry {
Expand Down

0 comments on commit 7c2af07

Please sign in to comment.