Skip to content
Snippets Groups Projects
Commit 169946c2 authored by Danny Auble's avatar Danny Auble
Browse files

temporary change for handling the lag for jobs being started in the dbd

parent 256e883c
No related branches found
No related tags found
No related merge requests found
......@@ -822,6 +822,39 @@ proc test_account_storage { } {
return $account_storage
}
################################################################
#
# Proc: test_using_slurmdbd
#
# Purpose: Since there is a lag at which the slurmdbd processes a job start
# we need to wait a bit to make sure the data has been set before proceeding.
# This is based upon
# the value of AccountingStorageType in the slurm.conf.
#
# Returns 1 if the system is running with slurmdbd, 0 otherwise
#
################################################################
proc test_using_slurmdbd { } {
global scontrol
log_user 0
set account_storage 0
spawn $scontrol show config
expect {
-re "(accounting_storage/slurmdbd)" {
set account_storage 1
exp_continue
}
eof {
wait
}
}
log_user 1
return $account_storage
}
################################################################
#
# Proc: priority_type
......
......@@ -51,6 +51,9 @@ if { [string compare [check_accounting_admin_level] "Administrator"] } {
send_user "\nWARNING: This test can't be run without being an Accounting administrator.\nUse sacctmgr mod user \$USER_NAME set admin=admin.\n"
exit 0
}
set using_slurmdbd [test_using_slurmdbd]
set cluster [get_cluster_name]
#
# Identify the user and his current default account
......@@ -185,6 +188,12 @@ if {$job_id == 0} {
set exit_code 1
}
}
if {$using_slurmdbd} {
sleep 30
}
################################################################
#
# Proc: sacct_job
......@@ -198,11 +207,12 @@ if {$job_id == 0} {
################################################################
proc sacct_job { soption job_id} {
global sacct
global sacct using_slurmdbd
set debug 0
set exit_code 0
set matches 0
set not_support 0
send_user "sacct -$soption -p -j $job_id\n"
if { $soption == "-brief" || $soption == "b" } {
......
......@@ -38,6 +38,7 @@ set file_in "test.$test_id.input"
set test_acct "test_acct"
set wk 21test
set timeout 60
print_header $test_id
#
......@@ -57,6 +58,8 @@ if { [string compare [check_accounting_admin_level] "Administrator"] } {
exit 0
}
set using_slurmdbd [test_using_slurmdbd]
set cn [get_cluster_name]
#
......@@ -161,6 +164,10 @@ expect {
}
}
if {$using_slurmdbd} {
sleep 30
}
spawn $sacct -j $job_id --fields=wckey
expect {
-re "$wk" {
......@@ -221,6 +228,10 @@ if {$job_id == 0} {
wait
}
}
if {$using_slurmdbd} {
sleep 30
}
spawn $sacct -j $job_id --fields=wckey
expect {
-re "$wk" {
......@@ -278,6 +289,11 @@ if {$job_id == 0} {
wait
}
}
if {$using_slurmdbd} {
sleep 30
}
spawn $sacct -j $job_id --fields=wckey
expect {
-re "$wk" {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment