Not able to run tests when remote host is set as client inside test case

Description

-->If the last executed test case sets remote host as client in the test case then while updating the results this issue is seen.
Below are the code and log snippet

Code-snippet:
def submit_job(self, host, user, exp_msg):
try:
self.server.client=host
j = Job(user)
cur_date = time.strftime("%Y-%m-%d")
j.create_script("hostname\necho 'sleeping for 200sec at % s'\n\
sleep 200\necho 'done with sleep % s'" %(cur_date, cur_date),
hostname=host)
jid = self.server.submit(j)
except PbsSubmitError, e:
_msg = "Error:Job submission failed with different err:% s" % e.msg
_msg += "Expected:%s" % exp_msg
self.assertTrue(exp_msg == e.msg, _msg)
def test_t10(self):
host = self.hostB
user = PBSROOT_user.name
exp_msg = ['qsub: Bad UID for job execution']
self.submit_job(host, user, exp_msg)

PTL logs snippet:
2017-04-05 04:58:53,370 INFO As expected job submission as root failed with error:['qsub: Bad UID for job execution']
2017-04-05 04:58:53,371 INFO ok

2017-04-05 04:58:53,372 INFO ================================================================================
run: 2, succeeded: 2, failed: 0, errors: 0, skipped: 0
Tests run in 0:00:16.412056
2017-04-05 04:58:53,372 INFO Cleaning up temporary files
2017-04-05 04:58:53,373 DEBUG pbspro-master: sudo -H /opt/tools/wrappers/rm -rf /tmp/PtlPbsJobScriptWHSMHw
2017-04-05 04:58:53,392 DEBUG out: []
2017-04-05 04:58:53,393 DEBUG err: []
2017-04-05 04:58:53,393 DEBUG rc: 0
2017-04-05 04:58:53,394 DEBUG pbspro-master: sudo -H /opt/tools/wrappers/rm -rf /tmp/PtlPbsJobScriptzdGfDi
2017-04-05 04:58:53,412 DEBUG out: []
2017-04-05 04:58:53,412 DEBUG err: []
2017-04-05 04:58:53,412 DEBUG rc: 0
Traceback (most recent call last):
File "/tmp/ptl/bin/pbs_benchpress", line 404, in <module>
plugins=plugins)
File "/tmp/ptl/lib/nose/core.py", line 121, in init
**extra_args)
File "/usr/lib64/python2.6/unittest.py", line 817, in init
self.runTests()
File "/tmp/ptl/lib/nose/core.py", line 207, in runTests
result = self.testRunner.run(self.test)
File "/tmp/ptl/lib/ptl/utils/plugins/ptl_test_runner.py", line 309, in run
self.config.plugins.finalize(result)
File "/tmp/ptl/lib/nose/plugins/manager.py", line 99, in call
return self.call(*arg, **kw)
File "/tmp/ptl/lib/nose/plugins/manager.py", line 167, in simple
result = meth(*arg, **kw)
File "/tmp/ptl/lib/ptl/utils/plugins/ptl_test_db.py", line 1149, in finalize
self.__dbconn.close()
File "/tmp/ptl/lib/ptl/utils/plugins/ptl_test_db.py", line 1043, in close
v.flush()
IOError: [Errno 9] Bad file descriptor

-->The tests passes if I execute the test cases individually but fails whenever we run the whole test suite
-->If I swap the list of moms in pbs_benchpress command(i.e specify remote host first and then server host) then the test script pass.

Acceptance Criteria

None

Status

Assignee

Unassigned

Reporter

zulekha mahalty

Severity

3-High

OS

None

Start Date

None

Pull Request URL

None

Story Points

1

Components

Priority

High