Skip to content

Commit

Permalink
Adjust Report unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
vkuznet committed Jul 19, 2023
1 parent 4f67aab commit eaa4b8f
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions test/python/WMCore_t/FwkJobReport_t/Report_t.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@
from WMCore.WMBase import getTestBase
from WMQuality.TestInitCouchApp import TestInitCouchApp

# third-party modules
import psutil


class ReportTest(unittest.TestCase):
"""
Expand Down Expand Up @@ -461,6 +464,23 @@ def testTaskJobID(self):

return

def test_SubprocessInfo(self):
"""
_SubprocessInfo_
Check CMSSW subprocess metrics
"""
report = Report("cmsRun1")
process = psutil.Process(os.getpid())
elapsedTime = 1
report.updateSubprocessInfo(process, elapsedTime)
subinfo = report.retrieveStep("cmsRun1").CMSSWSubprocess
sdict = subinfo.dictionary_()
self.assertEqual(sdict['elapsedTime'], 1)
self.assertEqual('cpu_user' in sdict, True)
self.assertEqual('mem_rss' in sdict, True)
# self.assertEqual('virt_used' in sdict, True)

def test_PerformanceReport(self):
"""
_PerformanceReport_
Expand Down

0 comments on commit eaa4b8f

Please sign in to comment.