Skip to content

Commit

Permalink
test: update tests for changes in flexible scheduling
Browse files Browse the repository at this point in the history
Problem: new changes in flexible scheduling now require a new
command line option to enable the feature in resource query
and no longer use or_slot but just slot

Add in trverser policy option and update jobspecs to use slot
instead of or_slot
  • Loading branch information
zekemorton committed Jan 30, 2025
1 parent c065261 commit 9a0ee5c
Show file tree
Hide file tree
Showing 9 changed files with 22 additions and 22 deletions.
4 changes: 2 additions & 2 deletions t/data/resource/jobspecs/flexible/test001.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ resources:
- type: socket
count: 1
with:
- type: or_slot
- type: slot
count: 1
label: small
with:
- type: core
count: 8
- type: gpu
count: 1
- type: or_slot
- type: slot
count: 1
label: big
with:
Expand Down
4 changes: 2 additions & 2 deletions t/data/resource/jobspecs/flexible/test002.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ resources:
- type: socket
count: 1
with:
- type: or_slot
- type: slot
count: 1
label: small
with:
- type: core
count: 8
- type: gpu
count: 1
- type: or_slot
- type: slot
count: 1
label: big
with:
Expand Down
6 changes: 3 additions & 3 deletions t/data/resource/jobspecs/flexible/test003.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
version: 9999
resources:
- type: or_slot
- type: slot
count: 2
label: default
with:
- type: core
count: 12
- type: memory
count: 4
- type: or_slot
- type: slot
count: 2
label: default
with:
Expand All @@ -18,7 +18,7 @@ resources:
count: 1
- type: memory
count: 4
- type: or_slot
- type: slot
count: 2
label: default
with:
Expand Down
2 changes: 1 addition & 1 deletion t/data/resource/jobspecs/flexible/test004.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ resources:
count: 8
- type: memory
count: 2
- type: or_slot
- type: slot
count: 1
label: default
with:
Expand Down
4 changes: 2 additions & 2 deletions t/data/resource/jobspecs/flexible/test005.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
version: 9999
resources:
- type: or_slot
- type: slot
count: 2
label: default
with:
Expand All @@ -16,7 +16,7 @@ resources:
count: 1
- type: memory
count: 6
- type: or_slot
- type: slot
count: 2
label: default
with:
Expand Down
2 changes: 1 addition & 1 deletion t/data/resource/jobspecs/flexible/test006.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
version: 9999
resources:
- type: or_slot
- type: slot
count: 1
label: default
with:
Expand Down
2 changes: 1 addition & 1 deletion t/data/resource/jobspecs/flexible/test007.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ resources:
count: 8
- type: memory
count: 2
- type: or_slot
- type: slot
count: 1
label: default
with:
Expand Down
4 changes: 2 additions & 2 deletions t/data/resource/jobspecs/flexible/test008.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
version: 9999
resources:
- type: or_slot
- type: slot
count: 1
label: default
with:
- type: core
count: 1
- type: or_slot
- type: slot
count: 1
label: default
with:
Expand Down
16 changes: 8 additions & 8 deletions t/t3037-resource-flexible.t
Original file line number Diff line number Diff line change
Expand Up @@ -13,63 +13,63 @@ cmds001="${cmd_dir}/cmds01.in"
test001_desc="JGF: allocate 9 jobspecs with flexible scheduling"
test_expect_success "${test001_desc}" '
sed "s~@TEST_SRCDIR@~${SHARNESS_TEST_SRCDIR}~g" ${cmds001} > cmds001 &&
${query} -L ${jgf} -f jgf -S CA -P high -t 001.R.out < cmds001 &&
${query} -L ${jgf} -f jgf -S CA -P high -T flexible -t 001.R.out < cmds001 &&
test_cmp 001.R.out ${exp_dir}/001.R.out
'

cmds002="${cmd_dir}/cmds02.in"
test002_desc="JGF: allocate jobspecs with valid and invalid or_slots"
test_expect_success "${test002_desc}" '
sed "s~@TEST_SRCDIR@~${SHARNESS_TEST_SRCDIR}~g" ${cmds002} > cmds002 &&
${query} -L ${jgf} -f jgf -S CA -P high -t 002.R.out < cmds002 &&
${query} -L ${jgf} -f jgf -S CA -P high -T flexible -t 002.R.out < cmds002 &&
test_cmp 002.R.out ${exp_dir}/002.R.out
'

cmds003="${cmd_dir}/cmds03.in"
test003_desc="JGF: allocate jobspecs with pristine jobspec"
test_expect_success "${test003_desc}" '
sed "s~@TEST_SRCDIR@~${SHARNESS_TEST_SRCDIR}~g" ${cmds003} > cmds003 &&
${query} -L ${jgf} -f jgf -S CA -P high -t 003.R.out < cmds003 &&
${query} -L ${jgf} -f jgf -S CA -P high -T flexible -t 003.R.out < cmds003 &&
test_cmp 003.R.out ${exp_dir}/003.R.out
'

cmds004="${cmd_dir}/cmds04.in"
test004_desc="JGF: try to allocate jobspec with slot and or_slot siblings"
test_expect_success "${test004_desc}" '
sed "s~@TEST_SRCDIR@~${SHARNESS_TEST_SRCDIR}~g" ${cmds004} > cmds004 &&
${query} -L ${jgf} -f jgf -S CA -P high -t 004.R.out < cmds004 &&
${query} -L ${jgf} -f jgf -S CA -P high -T flexible -t 004.R.out < cmds004 &&
test_cmp 004.R.out ${exp_dir}/004.R.out
'

cmds005="${cmd_dir}/cmds05.in"
test005_desc="JGF: try to allocate jobspec with or_slot count > 1"
test_expect_success "${test005_desc}" '
sed "s~@TEST_SRCDIR@~${SHARNESS_TEST_SRCDIR}~g" ${cmds005} > cmds005 &&
${query} -L ${jgf} -f jgf -S CA -P high -t 005.R.out < cmds005 &&
${query} -L ${jgf} -f jgf -S CA -P high -T flexible -t 005.R.out < cmds005 &&
test_cmp 005.R.out ${exp_dir}/005.R.out
'

cmds006="${cmd_dir}/cmds06.in"
test006_desc="JGF: try to allocate pristine jobspec with resources that don't exist"
test_expect_success "${test006_desc}" '
sed "s~@TEST_SRCDIR@~${SHARNESS_TEST_SRCDIR}~g" ${cmds006} > cmds006 &&
${query} -L ${jgf} -f jgf -S CA -P high -t 006.R.out < cmds006 &&
${query} -L ${jgf} -f jgf -S CA -P high -T flexible -t 006.R.out < cmds006 &&
test_cmp 006.R.out ${exp_dir}/006.R.out
'

cmds007="${cmd_dir}/cmds07.in"
test007_desc="JGF: try to allocate jobspec with resource and or_slot siblings"
test_expect_success "${test007_desc}" '
sed "s~@TEST_SRCDIR@~${SHARNESS_TEST_SRCDIR}~g" ${cmds007} > cmds007 &&
${query} -L ${jgf} -f jgf -S CA -P high -t 007.R.out < cmds007 &&
${query} -L ${jgf} -f jgf -S CA -P high -T flexible -t 007.R.out < cmds007 &&
test_cmp 007.R.out ${exp_dir}/007.R.out
'

cmds008="${cmd_dir}/cmds08.in"
test008_desc="JGF: try to allocate jobspec with identical or_slot configurations"
test_expect_success "${test008_desc}" '
sed "s~@TEST_SRCDIR@~${SHARNESS_TEST_SRCDIR}~g" ${cmds008} > cmds008 &&
${query} -L ${jgf} -f jgf -S CA -P high -t 008.R.out < cmds008 &&
${query} -L ${jgf} -f jgf -S CA -P high -T flexible -t 008.R.out < cmds008 &&
test_cmp 008.R.out ${exp_dir}/008.R.out
'

Expand Down

0 comments on commit 9a0ee5c

Please sign in to comment.