Skip to content

Commit 674e73a

Browse files
committed
TRT-2257: Restore fixed seed
1 parent 00af731 commit 674e73a

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"
@@ -267,11 +266,21 @@ func (o *GinkgoRunSuiteOptions) Run(suite *TestSuite, clusterConfig *clusterdisc
267266
return errors.WithMessage(err, "could not convert test specs to origin test cases")
268267
}
269268

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

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

688-
writeRunSuiteOptions(randSeed, totalNodes, workerNodes, parallelism, monitorTestInfo, o.JUnitDir, timeSuffix)
697+
writeRunSuiteOptions(seed, totalNodes, workerNodes, parallelism, monitorTestInfo, o.JUnitDir, timeSuffix)
689698
}
690699

691700
switch {

0 commit comments

Comments
 (0)