Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 14 additions & 5 deletions pkg/test/ginkgo/cmd_runsuite.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import (
"syscall"
"time"

"github.com/onsi/ginkgo/v2"
"github.com/openshift-eng/openshift-tests-extension/pkg/extension"
"github.com/openshift-eng/openshift-tests-extension/pkg/extension/extensiontests"
configv1 "github.com/openshift/api/config/v1"
Expand Down Expand Up @@ -267,11 +266,21 @@ func (o *GinkgoRunSuiteOptions) Run(suite *TestSuite, clusterConfig *clusterdisc
return errors.WithMessage(err, "could not convert test specs to origin test cases")
}

// We want to intentionally reduce variability
// in the ordering to highlight interactions between
// tests that lead to higher failures
// we may want to create a set of known seeds
// and randomly select from that group eventually
// to compare results
seed := int64(42)

// Previous seeding
// this ensures the tests are always run in random order to avoid
// any intra-tests dependencies
suiteConfig, _ := ginkgo.GinkgoConfiguration()
randSeed := suiteConfig.RandomSeed
r := rand.New(rand.NewSource(randSeed))
// suiteConfig, _ := ginkgo.GinkgoConfiguration()
// seed := suiteConfig.RandomSeed

r := rand.New(rand.NewSource(seed))
r.Shuffle(len(tests), func(i, j int) { tests[i], tests[j] = tests[j], tests[i] })

count := o.Count
Expand Down Expand Up @@ -685,7 +694,7 @@ func (o *GinkgoRunSuiteOptions) Run(suite *TestSuite, clusterConfig *clusterdisc
fmt.Fprintf(o.Out, "error: Unable to write e2e job run failures summary: %v", err)
}

writeRunSuiteOptions(randSeed, totalNodes, workerNodes, parallelism, monitorTestInfo, o.JUnitDir, timeSuffix)
writeRunSuiteOptions(seed, totalNodes, workerNodes, parallelism, monitorTestInfo, o.JUnitDir, timeSuffix)
}

switch {
Expand Down