本文整理汇总了Python中DIRAC.WorkloadManagementSystem.Client.WMSClient.WMSClient.rescheduleJob方法的典型用法代码示例。如果您正苦于以下问题:Python WMSClient.rescheduleJob方法的具体用法?Python WMSClient.rescheduleJob怎么用?Python WMSClient.rescheduleJob使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DIRAC.WorkloadManagementSystem.Client.WMSClient.WMSClient
的用法示例。
在下文中一共展示了WMSClient.rescheduleJob方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_FullChain
# 需要导入模块: from DIRAC.WorkloadManagementSystem.Client.WMSClient import WMSClient [as 别名]
# 或者: from DIRAC.WorkloadManagementSystem.Client.WMSClient.WMSClient import rescheduleJob [as 别名]
def test_FullChain( self ):
""" This test will
- call all the WMSClient methods
that will end up calling all the JobManager service methods
- use the JobMonitoring to verify few properties
- call the JobCleaningAgent to eliminate job entries from the DBs
"""
wmsClient = WMSClient()
jobMonitor = JobMonitoringClient()
jobStateUpdate = RPCClient( 'WorkloadManagement/JobStateUpdate' )
# create the job
job = helloWorldJob()
jobDescription = createFile( job )
# submit the job
res = wmsClient.submitJob( job._toJDL( xmlFile = jobDescription ) )
self.assert_( res['OK'] )
# self.assertEqual( type( res['Value'] ), int )
# self.assertEqual( res['Value'], res['JobID'] )
# jobID = res['JobID']
jobID = res['Value']
# updating the status
jobStateUpdate.setJobStatus( jobID, 'Running', 'Executing Minchiapp', 'source' )
# reset the job
res = wmsClient.resetJob( jobID )
self.assert_( res['OK'] )
# reschedule the job
res = wmsClient.rescheduleJob( jobID )
self.assert_( res['OK'] )
res = jobMonitor.getJobStatus( jobID )
self.assert_( res['OK'] )
self.assertEqual( res['Value'], 'Received' )
# updating the status again
jobStateUpdate.setJobStatus( jobID, 'Matched', 'matching', 'source' )
# kill the job
res = wmsClient.killJob( jobID )
self.assert_( res['OK'] )
res = jobMonitor.getJobStatus( jobID )
self.assert_( res['OK'] )
self.assertEqual( res['Value'], 'Killed' )
# updating the status aaaagain
jobStateUpdate.setJobStatus( jobID, 'Done', 'matching', 'source' )
# kill the job
res = wmsClient.killJob( jobID )
self.assert_( res['OK'] )
res = jobMonitor.getJobStatus( jobID )
self.assert_( res['OK'] )
self.assertEqual( res['Value'], 'Done' ) # this time it won't kill... it's done!
# delete the job - this will just set its status to "deleted"
res = wmsClient.deleteJob( jobID )
self.assert_( res['OK'] )
res = jobMonitor.getJobStatus( jobID )
self.assert_( res['OK'] )
self.assertEqual( res['Value'], 'Deleted' )