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
7512a5ba
Commit
7512a5ba
authored
15 years ago
by
Moe Jette
Browse files
Options
Downloads
Patches
Plain Diff
make test more correct (wait for prompt before sending next command)
from michal novotny
parent
0545484d
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
testsuite/expect/test15.23
+29
-7
29 additions, 7 deletions
testsuite/expect/test15.23
with
29 additions
and
7 deletions
testsuite/expect/test15.23
+
29
−
7
View file @
7512a5ba
...
@@ -36,7 +36,6 @@ source ./globals
...
@@ -36,7 +36,6 @@ source ./globals
set test_id "15.23"
set test_id "15.23"
set exit_code 0
set exit_code 0
set job_id 0
set job_id 0
set timeout $max_job_delay
print_header $test_id
print_header $test_id
...
@@ -51,6 +50,7 @@ set env(SALLOC_TIMELIMIT) 2
...
@@ -51,6 +50,7 @@ set env(SALLOC_TIMELIMIT) 2
# Spawn a job via salloc using these environment variables
# Spawn a job via salloc using these environment variables
#
#
set matches 0
set matches 0
set timeout $max_job_delay
set salloc_pid [spawn $salloc -N1 $bin_bash]
set salloc_pid [spawn $salloc -N1 $bin_bash]
expect {
expect {
-re "debug: Entering _msg_thr_internal" {
-re "debug: Entering _msg_thr_internal" {
...
@@ -59,10 +59,32 @@ expect {
...
@@ -59,10 +59,32 @@ expect {
}
}
-re "Granted job allocation ($number)" {
-re "Granted job allocation ($number)" {
set job_id $expect_out(1,string)
set job_id $expect_out(1,string)
send "$scontrol show job $job_id\r"
send "exit\r"
exp_continue
exp_continue
}
}
-re $prompt {
#send_user "Job initiated\n"
}
timeout {
send_user "\nFAILURE: srun not responding\n"
if {$job_id != 0} {
cancel_job $job_id
}
slow_kill [expr 0 - $salloc_pid]
set exit_code 1
}
eof {
wait
}
}
if {$job_id == 0} {
send_user "\nFAILURE: did not get job_id\n"
exit 1
}
set timeout 5
send "$scontrol show job $job_id\r"
expect {
-re "TimeLimit=($number):($number):" {
-re "TimeLimit=($number):($number):" {
set time_limit [expr $expect_out(1,string) * 60 + $expect_out(2,string)]
set time_limit [expr $expect_out(1,string) * 60 + $expect_out(2,string)]
if {$time_limit == 2} {
if {$time_limit == 2} {
...
@@ -73,6 +95,10 @@ expect {
...
@@ -73,6 +95,10 @@ expect {
}
}
exp_continue
exp_continue
}
}
-re $prompt {
send "exit\r"
exp_continue
}
timeout {
timeout {
send_user "\nFAILURE: srun not responding\n"
send_user "\nFAILURE: srun not responding\n"
if {$job_id != 0} {
if {$job_id != 0} {
...
@@ -86,10 +112,6 @@ expect {
...
@@ -86,10 +112,6 @@ expect {
}
}
}
}
if {$job_id == 0} {
send_user "\nFAILURE: did not get job_id\n"
exit 1
}
if {$matches != 2} {
if {$matches != 2} {
send_user "\nFAILURE: processed $matches of 2 environment variables\n"
send_user "\nFAILURE: processed $matches of 2 environment variables\n"
set exit_code 1
set exit_code 1
...
...
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