Skip to content

Commit

Permalink
TestMultipleSchedulers.test_fairshare_usage fails due to race condition
Browse files Browse the repository at this point in the history
  • Loading branch information
Bhagat-Rajput committed Jan 21, 2019
1 parent ca53e30 commit 9c96636
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions test/tests/functional/pbs_multi_sched.py
Expand Up @@ -647,7 +647,6 @@ def test_multi_fairshare(self):
self.assertEquals(n.nshares, sc3_shares)
self.assertEquals(n.usage, sc3_usage)

@timeout(240)
def test_fairshare_usage(self):
"""
Test the schedulers fairshare usage file and
Expand Down Expand Up @@ -700,16 +699,23 @@ def test_fairshare_usage(self):
self.server.expect(JOB, {'job_state': 'Q'}, id=sc1_jid2)
self.server.manager(MGR_CMD_SET, SCHED, {'scheduling': 'True'},
id='sc1')
# need to delete the running job because PBS has only 1 ncpu and
# our work is also done with the job.
# this step will decrease the execution time as well
self.server.delete(sc1_jid1, wait=True)
# pbsuser3 job will run after pbsuser1
self.server.expect(JOB, {'job_state': 'R'}, id=sc1_jid3)
self.server.expect(JOB, {'job_state': 'Q'}, id=sc1_jid2)
self.server.manager(MGR_CMD_SET, SCHED, {'scheduling': 'True'},
id='sc1')
# deleting the currently running job
self.server.delete(sc1_jid3, wait=True)
# pbsuser2 job will run in the end
self.server.expect(JOB, {'job_state': 'R'}, id=sc1_jid2)
self.server.manager(MGR_CMD_SET, SCHED, {'scheduling': 'True'},
id='sc1')
self.server.log_match(sc1_jid2 + ";Exit_status")
# deleting the currently running job
self.server.delete(sc1_jid2, wait=True)
# query fairshare and check usage
sc1_fs_user1 = self.scheds['sc1'].query_fairshare(name=str(TEST_USER1))
self.assertEquals(sc1_fs_user1.usage, 101)
Expand Down Expand Up @@ -738,16 +744,21 @@ def test_fairshare_usage(self):
self.server.expect(JOB, {'job_state': 'Q'}, id=sc1_jid2)
self.server.manager(MGR_CMD_SET, SCHED, {'scheduling': 'True'},
id='sc1')
# deleting the currently running job
self.server.delete(sc1_jid4, wait=True)
# pbsuser1 job will run after pbsuser4
self.server.expect(JOB, {'job_state': 'R'}, id=sc1_jid1)
self.server.expect(JOB, {'job_state': 'Q'}, id=sc1_jid2)
self.server.manager(MGR_CMD_SET, SCHED, {'scheduling': 'True'},
id='sc1')
# deleting the currently running job
self.server.delete(sc1_jid1, wait=True)
# pbsuser2 job will run in the end
self.server.expect(JOB, {'job_state': 'R'}, id=sc1_jid2)
self.server.manager(MGR_CMD_SET, SCHED, {'scheduling': 'True'},
id='sc1')
self.server.log_match(sc1_jid2 + ";Exit_status")
# deleting the currently running job
self.server.delete(sc1_jid2, wait=True)
# query fairshare and check usage
sc1_fs_user1 = self.scheds['sc1'].query_fairshare(name=str(TEST_USER1))
self.assertEquals(sc1_fs_user1.usage, 201)
Expand Down

0 comments on commit 9c96636

Please sign in to comment.