Skip to content

Commit

Permalink
🪲 fix the unit test to set procid properly
Browse files Browse the repository at this point in the history
  • Loading branch information
aminnj committed Oct 3, 2018
1 parent 09536d0 commit 0011467
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions test/CondorTask_t.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,22 +165,22 @@ def test_condor_handler(self):
"remove_held_x_hours": remove_held_x_hours,
}

job_dict = {"ClusterId": 123, "JobStatus": "R", "EnteredCurrentStatus": time.time()}
job_dict = {"ClusterId": 123, "ProcId": 0, "JobStatus": "R", "EnteredCurrentStatus": time.time()}
self.assertEqual(self.dummy.handle_condor_job(this_job_dict=job_dict, **params), "RUNNING")

job_dict = {"ClusterId": 123, "JobStatus": "R", "EnteredCurrentStatus": time.time()-(remove_running_x_hours-epsilon_hours)*3600}
job_dict = {"ClusterId": 123, "ProcId": 0, "JobStatus": "R", "EnteredCurrentStatus": time.time()-(remove_running_x_hours-epsilon_hours)*3600}
self.assertEqual(self.dummy.handle_condor_job(this_job_dict=job_dict, **params), "RUNNING")

job_dict = {"ClusterId": 123, "JobStatus": "R", "EnteredCurrentStatus": time.time()-(remove_running_x_hours+epsilon_hours)*3600}
job_dict = {"ClusterId": 123, "ProcId": 0, "JobStatus": "R", "EnteredCurrentStatus": time.time()-(remove_running_x_hours+epsilon_hours)*3600}
self.assertEqual(self.dummy.handle_condor_job(this_job_dict=job_dict, **params), "LONG_RUNNING_REMOVED")

job_dict = {"ClusterId": 123, "JobStatus": "I", "EnteredCurrentStatus": time.time()}
job_dict = {"ClusterId": 123, "ProcId": 0, "JobStatus": "I", "EnteredCurrentStatus": time.time()}
self.assertEqual(self.dummy.handle_condor_job(this_job_dict=job_dict, **params), "IDLE")

job_dict = {"ClusterId": 123, "JobStatus": "H", "EnteredCurrentStatus": time.time()-(remove_held_x_hours-epsilon_hours)*3600}
job_dict = {"ClusterId": 123, "ProcId": 0, "JobStatus": "H", "EnteredCurrentStatus": time.time()-(remove_held_x_hours-epsilon_hours)*3600}
self.assertEqual(self.dummy.handle_condor_job(this_job_dict=job_dict, **params), "HELD")

job_dict = {"ClusterId": 123, "JobStatus": "H", "EnteredCurrentStatus": time.time()-(remove_held_x_hours+epsilon_hours)*3600}
job_dict = {"ClusterId": 123, "ProcId": 0, "JobStatus": "H", "EnteredCurrentStatus": time.time()-(remove_held_x_hours+epsilon_hours)*3600}
self.assertEqual(self.dummy.handle_condor_job(this_job_dict=job_dict, **params), "HELD_AND_REMOVED")


Expand Down

0 comments on commit 0011467

Please sign in to comment.