Skip to content

Commit 560414a

Browse files
Merge pull request #30392 from neisw/trt-2257-fixed-seed
TRT-2257: Restore fixed seed
2 parents 87710bd + 674e73a commit 560414a

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

pkg/test/ginkgo/cmd_runsuite.go

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ import (
1717
"syscall"
1818
"time"
1919

20-
"github.com/onsi/ginkgo/v2"
2120
"github.com/openshift-eng/openshift-tests-extension/pkg/extension"
2221
"github.com/openshift-eng/openshift-tests-extension/pkg/extension/extensiontests"
2322
configv1 "github.com/openshift/api/config/v1"
@@ -271,11 +270,21 @@ func (o *GinkgoRunSuiteOptions) Run(suite *TestSuite, clusterConfig *clusterdisc
271270
return errors.WithMessage(err, "could not convert test specs to origin test cases")
272271
}
273272

273+
// We want to intentionally reduce variability
274+
// in the ordering to highlight interactions between
275+
// tests that lead to higher failures
276+
// we may want to create a set of known seeds
277+
// and randomly select from that group eventually
278+
// to compare results
279+
seed := int64(42)
280+
281+
// Previous seeding
274282
// this ensures the tests are always run in random order to avoid
275283
// any intra-tests dependencies
276-
suiteConfig, _ := ginkgo.GinkgoConfiguration()
277-
randSeed := suiteConfig.RandomSeed
278-
r := rand.New(rand.NewSource(randSeed))
284+
// suiteConfig, _ := ginkgo.GinkgoConfiguration()
285+
// seed := suiteConfig.RandomSeed
286+
287+
r := rand.New(rand.NewSource(seed))
279288
r.Shuffle(len(tests), func(i, j int) { tests[i], tests[j] = tests[j], tests[i] })
280289

281290
count := o.Count
@@ -700,7 +709,7 @@ func (o *GinkgoRunSuiteOptions) Run(suite *TestSuite, clusterConfig *clusterdisc
700709
fmt.Fprintf(o.Out, "error: Unable to write e2e job run failures summary: %v", err)
701710
}
702711

703-
writeRunSuiteOptions(randSeed, totalNodes, workerNodes, parallelism, monitorTestInfo, o.JUnitDir, timeSuffix)
712+
writeRunSuiteOptions(seed, totalNodes, workerNodes, parallelism, monitorTestInfo, o.JUnitDir, timeSuffix)
704713
}
705714

706715
switch {

0 commit comments

Comments
 (0)