Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Slurm
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
tud-zih-energy
Slurm
Commits
e404314d
Commit
e404314d
authored
15 years ago
by
Moe Jette
Browse files
Options
Downloads
Patches
Plain Diff
expand logic for testing job step time limit enforcement
parent
5b5f6b35
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
testsuite/expect/test2.13
+39
-8
39 additions, 8 deletions
testsuite/expect/test2.13
with
39 additions
and
8 deletions
testsuite/expect/test2.13
+
39
−
8
View file @
e404314d
...
@@ -35,21 +35,27 @@ source ./globals
...
@@ -35,21 +35,27 @@ source ./globals
set test_id "2.13"
set test_id "2.13"
set exit_code 0
set exit_code 0
set file_in "test$test_id.input"
set file_in "test$test_id.input"
set file_out "test$test_id.output"
set job_id 0
set job_id 0
set orig_time 0
set orig_time 0
set new_time 0
set new_time 0
print_header $test_id
print_header $test_id
exec $bin_rm -f $file_in $file_out
#
#
# Build input script file
# Build input script file
#
#
make_bash_script $file_in "$srun -t5 $bin_sleep 60"
make_bash_script $file_in "
$bin_echo TEST_BEGIN
$srun -t5 $bin_sleep 120
$bin_echo TEST_FINISH
"
#
#
# Submit a job so we have something to work with
# Submit a job so we have something to work with
#
#
set srun_pid [spawn $sbatch --output=
/dev/null --error=/dev/null
-t
1
$file_in]
set srun_pid [spawn $sbatch --output=
$file_out
-t
3
$file_in]
expect {
expect {
-re "Submitted batch job ($number)" {
-re "Submitted batch job ($number)" {
set job_id $expect_out(1,string)
set job_id $expect_out(1,string)
...
@@ -64,13 +70,12 @@ expect {
...
@@ -64,13 +70,12 @@ expect {
wait
wait
}
}
}
}
exec $bin_rm -f $file_in
if {$job_id == 0} {
if {$job_id == 0} {
send_user "\nFAILURE: srun failed to initiate job\n"
send_user "\nFAILURE: srun failed to initiate job\n"
exit 1
exit 1
}
}
#
#
# Wait for job and step to start running
# Wait for job
_
and
_
step to start running
#
#
if {[wait_for_job $job_id "RUNNING"] != 0} {
if {[wait_for_job $job_id "RUNNING"] != 0} {
send_user "\nFAILURE: waiting for job to start running\n"
send_user "\nFAILURE: waiting for job to start running\n"
...
@@ -103,7 +108,7 @@ if {$orig_time != 5} {
...
@@ -103,7 +108,7 @@ if {$orig_time != 5} {
#
#
# Change that job's priority
# Change that job's priority
#
#
spawn $scontrol update StepId=$job_id TimeLimit=1
2
spawn $scontrol update StepId=$job_id TimeLimit=1
expect {
expect {
timeout {
timeout {
send_user "\nFAILURE: scontrol not responding\n"
send_user "\nFAILURE: scontrol not responding\n"
...
@@ -131,15 +136,41 @@ expect {
...
@@ -131,15 +136,41 @@ expect {
wait
wait
}
}
}
}
if {$orig_time != 1
2
} {
if {$orig_time != 1} {
send_user "\nFAILURE: Failed to update step time limit\n"
send_user "\nFAILURE: Failed to update step time limit\n"
set exit_code 1
set exit_code 1
}
}
if {[cancel_job $job_id] != 0} {
#
set exit_code 1
# Wait for step to exit and check output file
# Look for message generated before and after srun (job step) time limit
#
if {[wait_for_job $job_id "DONE"] != 0} {
send_user "\nFAILURE: waiting for job to terminate\n"
exit 1
}
if {[wait_for_file $file_out] != 0} {
send_user "\nFAILURE: job output file not found\n"
exit 1
}
set matches 0
spawn $bin_cat $file_out
expect {
-re "(TEST_BEGIN|TIME LIMIT|TEST_FINISH)" {
incr matches
exp_continue
}
eof {
wait
}
}
if {$matches != 3} {
send_user "\nFAILURE: No step time limit message ($matches!=3)\n"
exit 1
}
}
if {$exit_code == 0} {
if {$exit_code == 0} {
exec $bin_rm -f $file_in $file_out
send_user "\nSUCCESS\n"
send_user "\nSUCCESS\n"
}
}
exit $exit_code
exit $exit_code
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment