Ptl_testlib and scheduler restart

When trying to call:
import ptl.lib.pbs_testlib as ptl_testlib
sched = ptl_testlib.Scheduler()
sched.restart()
Traceback (most recent call last):
File “”, line 1, in
File “/opt/ptl/lib/python3.7/site-packages/ptl/lib/pbs_testlib.py”, line 11141, in restart
return self.start()
File “/opt/ptl/lib/python3.7/site-packages/ptl/lib/pbs_testlib.py”, line 11087, in start
if self.attributes[‘id’] != ‘default’:

is it expected that a restart() call to the scheduler should work?
also along the same lines a stop() call works fine but the next start() call fails the same
way. which is at least consistent.

thanks

s

Hey @steveheistand , can you let us know which code are you using, Is it master or latest release(v20.0.1) ?
Can you tell us the exact steps/script used for reproducing the error and whole error you are seeing?

pbs_version=20.0.1
and those were the steps to reproduce, I was just running python interactively.

root# python3
Python 3.7.10 (default, Jun 3 2021, 00:02:01)
[GCC 7.3.1 20180712 (Red Hat 7.3.1-13)] on linux
Type “help”, “copyright”, “credits” or “license” for more information.

import ptl.lib.pbs_testlib as ptl_testlib
sched = ptl_testlib.Scheduler()
sched.restart()
Traceback (most recent call last):
File “”, line 1, in
File “/opt/ptl/lib/python3.7/site-packages/ptl/lib/pbs_testlib.py”, line 11141, in restart
return self.start()
File “/opt/ptl/lib/python3.7/site-packages/ptl/lib/pbs_testlib.py”, line 11087, in start
if self.attributes[‘id’] != ‘default’:
KeyError: ‘id’

Hi @steveheistand ,

API calls will work inside a PTL test case or a library. PTL runs its Setup and creates dictionaries of data by querying PBS for ex: server attributes, sched attributes, mom attributes. So in this case it is trying to verify the name of the scheduler but the dictionary is not created yet.
Running interactively won’t work.

Please go through the following link to setting up PTL.
https://openpbs.atlassian.net/wiki/spaces/DG/pages/519438366/Setting+Up+PTL+the+First+Time

ahh yes calling sched.initialise_service() before trying the restart() does make life better.
It was returning isUp() and get_pid() just fine without it but restart() does need it.

thanks

s

1 Like