Skip to content

Commit 6a7df2d

Browse files
committed
kolaTestIso: collapse all runs into single map
In this commit we collapse all test iso run definition into a single map (testIsoRuns) rather than two (testIsoRuns1, testIsoRuns2), while still retaining the property of only running two parallel runs at any given time. The reason for doing this is I noticed in an s390x run it would first run `s390x:kola:metal` and then run `s390x:kola:multipath`, serially. In this case it would be more appropriate to run both of those together in a single parallel run.
1 parent 7b45079 commit 6a7df2d

1 file changed

Lines changed: 16 additions & 8 deletions

File tree

vars/kolaTestIso.groovy

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,8 @@ def call(params = [:]) {
3939
// list of identifiers for each run for log collection
4040
def ids = []
4141

42-
def testIsoRuns1 = [:]
43-
def testIsoRuns2 = [:]
44-
testIsoRuns1["${arch}:kola:metal"] = {
42+
def testIsoRuns = [:]
43+
testIsoRuns["${arch}:kola:metal"] = {
4544
def id = marker == "" ? "kola-testiso-metal" : "kola-testiso-metal-${marker}"
4645
ids += id
4746
def scenariosArg = scenarios == "" ? "" : "--scenarios ${scenarios}"
@@ -52,7 +51,7 @@ def call(params = [:]) {
5251
// https://github.com/coreos/fedora-coreos-tracker/issues/1261
5352
// and testiso for s390x doesn't support iso installs either
5453
if (arch != 's390x') {
55-
testIsoRuns1["${arch}:kola:metal4k"] = {
54+
testIsoRuns["${arch}:kola:metal4k"] = {
5655
def id = marker == "" ? "kola-testiso-metal4k" : "kola-testiso-metal4k-${marker}"
5756
ids += id
5857
def scenariosArg = scenarios4k == "" ? "" : "--scenarios ${scenarios4k}"
@@ -61,7 +60,7 @@ def call(params = [:]) {
6160
}
6261
}
6362
if (!params['skipMultipath']) {
64-
testIsoRuns2["${arch}:kola:multipath"] = {
63+
testIsoRuns["${arch}:kola:multipath"] = {
6564
def id = marker == "" ? "kola-testiso-multipath" : "kola-testiso-multipath-${marker}"
6665
ids += id
6766
shwrap("cosa kola testiso -S --qemu-multipath ${extraArgsMultipath} --scenarios ${scenariosMultipath} --output-dir ${outputDir}/${id}")
@@ -74,7 +73,7 @@ def call(params = [:]) {
7473
// https://pagure.io/fedora-infrastructure/issue/7361
7574
// https://github.com/coreos/coreos-assembler/blob/93efb63dcbd63dc04a782e2c6c617ae0cd4a51c8/mantle/platform/qemu.go#L1156
7675
if (arch == 'x86_64') {
77-
testIsoRuns2["${arch}:kola:uefi"] = {
76+
testIsoRuns["${arch}:kola:uefi"] = {
7877
def id = marker == "" ? "kola-testiso-uefi" : "kola-testiso-uefi-${marker}"
7978
ids += id
8079
shwrap("cosa shell -- mkdir -p ${outputDir}/${id}")
@@ -87,8 +86,17 @@ def call(params = [:]) {
8786
// Run the Kola tests from the cosaDir
8887
dir(cosaDir) {
8988
try {
90-
parallel(testIsoRuns1)
91-
parallel(testIsoRuns2)
89+
// Run at most two testiso runs at a time to try not to
90+
// exceed 8G of memory usage.
91+
def runs = [:]
92+
testIsoRuns.eachWithIndex { key, value, index ->
93+
def i = index + 1 // index starts at 0, adjust
94+
runs[key] = value
95+
if (i % 2 == 0 || i == testIsoRuns.size()) {
96+
parallel runs
97+
runs = [:] // empty out map for next iteration
98+
}
99+
}
92100
} finally {
93101
for (id in ids) {
94102
shwrap("cosa shell -- tar -c --xz ${outputDir}/${id} > ${env.WORKSPACE}/${id}-${token}.tar.xz || :")

0 commit comments

Comments
 (0)