Skip to content

Commit dc1f63e

Browse files
committed
fix: updated test calls
1 parent f8cc981 commit dc1f63e

File tree

2 files changed

+19
-13
lines changed

2 files changed

+19
-13
lines changed

src/DIRAC/WorkloadManagementSystem/Agent/test/Test_Agent_StalledJobAgent.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ def sja(mocker):
2828
mocker.patch("DIRAC.WorkloadManagementSystem.Agent.StalledJobAgent.rescheduleJobs", return_value=MagicMock())
2929
mocker.patch("DIRAC.WorkloadManagementSystem.Agent.StalledJobAgent.PilotAgentsDB", return_value=MagicMock())
3030
mocker.patch("DIRAC.WorkloadManagementSystem.Agent.StalledJobAgent.getJobParameters", return_value=MagicMock())
31+
mocker.patch("DIRAC.WorkloadManagementSystem.Agent.StalledJobAgent.kill_delete_jobs", return_value=MagicMock())
3132

3233
stalledJobAgent = StalledJobAgent()
3334
stalledJobAgent._AgentModule__configDefaults = mockAM

tests/Integration/WorkloadManagementSystem/Test_Client_WMS.py

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,9 @@ def test_JobStateUpdateAndJobMonitoring() -> None:
289289
# forcing the update
290290
res = jobStateUpdateClient.setJobStatus(jobID, JobStatus.RUNNING, "running", "source", None, True)
291291
assert res["OK"], res["Message"]
292-
res = jobStateUpdateClient.setJobParameters(jobID, [("par1", "par1Value"), ("par2", "par2Value")])
292+
res = jobStateUpdateClient.setJobParameters(jobID, [("CPUNormalizationFactor", 10), ("HostName", "hlt123")])
293+
assert res["OK"], res["Message"]
294+
res = jobStateUpdateClient.setJobParameter(jobID, "Pilot_Reference", "https://pilot.reference.com/123456")
293295
assert res["OK"], res["Message"]
294296
res = jobStateUpdateClient.setJobApplicationStatus(jobID, "app status", "source")
295297
assert res["OK"], res["Message"]
@@ -303,25 +305,25 @@ def test_JobStateUpdateAndJobMonitoring() -> None:
303305

304306
time.sleep(3)
305307

306-
res = jobMonitoringClient.getJobParameters(jobID, ["par1", "par2"])
308+
res = jobMonitoringClient.getJobParameters(jobID, ["CPUNormalizationFactor", "HostName"])
307309
assert res["OK"], res["Message"]
308-
assert res["Value"] == {jobID: {"par1": "par1Value", "par2": "par2Value"}}
310+
assert res["Value"] == {jobID: {"CPUNormalizationFactor": 10, "HostName": "hlt123"}}
309311

310-
res = jobMonitoringClient.getJobParameter(jobID, "par1")
312+
res = jobMonitoringClient.getJobParameter(jobID, "Pilot_Reference")
311313
assert res["OK"], res["Message"]
312-
assert res["Value"] == {"par1": "par1Value"}
314+
assert res["Value"] == {"Pilot_Reference": "https://pilot.reference.com/123456"}
313315

314316
res = jobMonitoringClient.getJobParameters(jobID)
315317
assert res["OK"], res["Message"]
316318
assert jobID in res["Value"]
317-
assert "par1" in res["Value"][jobID]
318-
assert "par2" in res["Value"][jobID]
319-
assert res["Value"][jobID]["par1"] == "par1Value"
320-
assert res["Value"][jobID]["par2"] == "par2Value"
319+
assert "CPUNormalizationFactor" in res["Value"][jobID]
320+
assert "HostName" in res["Value"][jobID]
321+
assert res["Value"][jobID]["CPUNormalizationFactor"] == 10
322+
assert res["Value"][jobID]["HostName"] == "hlt123"
321323

322-
res = jobMonitoringClient.getJobParameters(jobID, "par1")
324+
res = jobMonitoringClient.getJobParameters(jobID, "Pilot_Reference")
323325
assert res["OK"], res["Message"]
324-
assert res["Value"] == {jobID: {"par1": "par1Value"}}
326+
assert res["Value"] == {jobID: {"Pilot_Reference": "https://pilot.reference.com/123456"}}
325327

326328
res = jobMonitoringClient.getJobAttribute(jobID, "Site")
327329
assert res["OK"], res["Message"]
@@ -332,9 +334,12 @@ def test_JobStateUpdateAndJobMonitoring() -> None:
332334
assert res["Value"]["ApplicationStatus"] == "app status"
333335
assert res["Value"]["JobName"] == "helloWorld"
334336

337+
res = jobStateUpdateClient.setJobAttribute(jobID, "ApplicationStatus", "some_app_status")
338+
assert res["OK"], res["Message"]
339+
335340
res = jobMonitoringClient.getJobSummary(jobID)
336341
assert res["OK"], res["Message"]
337-
assert res["Value"]["ApplicationStatus"] == "app status"
342+
assert res["Value"]["ApplicationStatus"] == "some_app_status"
338343
assert res["Value"]["Status"] == JobStatus.RUNNING
339344

340345
res = jobMonitoringClient.getJobHeartBeatData(jobID)
@@ -355,7 +360,7 @@ def test_JobStateUpdateAndJobMonitoring() -> None:
355360
assert res["OK"], res["Message"]
356361
assert res["Value"]["Status"] == JobStatus.DONE
357362
assert res["Value"]["MinorStatus"] == "MinorStatus"
358-
assert res["Value"]["ApplicationStatus"] == "app status"
363+
assert res["Value"]["ApplicationStatus"] == "some_app_status"
359364

360365
res = jobStateUpdateClient.sendHeartBeat(jobID, {"bih": "bih"}, {"boh": "boh"})
361366
assert res["OK"], res["Message"]

0 commit comments

Comments
 (0)