Skip to content

Commit 06c0a13

Browse files
committed
Wait for slurmdbd to be ready before adding the cluster
(SOFTWARE-4446)
1 parent a564c94 commit 06c0a13

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

osgtest/tests/test_290_slurm.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,10 @@
66
import osgtest.library.service as service
77

88
CLUSTER_NAME = 'osg_test'
9-
CTLD_LOG = '/var/log/slurm/slurmctld.log'
10-
SLURM_LOG = '/var/log/slurm/slurm.log'
9+
SLURM_LOG_DIR = '/var/log/slurm/'
10+
CTLD_LOG = SLURM_LOG_DIR + 'slurmctld.log'
11+
SLURM_LOG = SLURM_LOG_DIR + 'slurm.log'
12+
SLURMDBD_LOG = SLURM_LOG_DIR + 'slurmdbd.log'
1113
SHORT_HOSTNAME = core.get_hostname().split('.')[0]
1214

1315
SLURMDBD_CONFIG = """AuthType=auth/munge
@@ -88,6 +90,7 @@ def test_01_slurm_config(self):
8890

8991
def test_02_start_slurmdbd(self):
9092
core.state['slurmdbd.started-service'] = False
93+
core.state['slurmdbd.ready'] = False
9194
self.slurm_reqs()
9295
self.skip_bad_unless(mysql.is_running(), 'slurmdbd requires mysql')
9396
core.config['slurmdbd.config'] = os.path.join(core.config['slurm.config-dir'], 'slurmdbd.conf')
@@ -110,7 +113,12 @@ def test_02_start_slurmdbd(self):
110113
port=mysql.PORT),
111114
owner='slurm',
112115
chmod=0o644)
116+
117+
stat = core.get_stat(SLURMDBD_LOG)
113118
service.check_start('slurmdbd')
119+
sentinel = core.monitor_file(SLURMDBD_LOG, stat, 'slurmdbd version.+started', 30.0)
120+
if sentinel:
121+
core.state['slurmdbd.ready'] = True
114122

115123
# Adding the cluster to the database
116124
command = ('sacctmgr', '-i', 'add', 'cluster', CLUSTER_NAME)

0 commit comments

Comments
 (0)