Skip to content

test (BKK): allow for little jitter in bookkeeping test time comparisons

Christophe Haen requested to merge chaen/LHCbDIRAC:master_fix_bkMCtest into master

Be a bit less precise with time comparison (fix that sort of CI failure https://gitlab.cern.ch/lhcb-dirac/LHCbDIRAC/-/jobs/21927321)

=================================== FAILURES ===================================
____________________________ test_getJobInformation ____________________________

    def test_getJobInformation():
        """
        test the job information method
        """
        jobStart = jobEnd = datetime.datetime.now()
        jobStart = jobEnd = jobStart.replace(second=0, microsecond=0)
    
        retVal = bk.getJobInformation(
            {
                "LFN": [
                    "/lhcb/MC/2012/DIGI/00056438/0000/00056438_00001025_test_8.digi",
                    "/lhcb/MC/2012/DIGI/00056438/0000/00056438_00001025_test_7.digi",
                ]
            }
        )
[...]
        for record in retVal["Value"]:
            assert sorted(params) == sorted(record)
            record.pop("JobId")
            record.pop("StepId")
            if record["CPUTime"] == d1["CPUTime"]:
>               assert sorted(record.items()) == sorted(d1.items())  # can be an iterator
E               AssertionError: assert [('CPUTime', ...t', 411), ...] == [('CPUTime', ...t', 411), ...]
E                 At index 9 diff: ('JobEnd', datetime.datetime(2022, 5, 19, 15, 54)) != ('JobEnd', datetime.datetime(2022, 5, 19, 15, 55))
E                 Full diff:
E                   [
E                    ('CPUTime', 472.93),
E                    ('ConfigName', 'test'),
E                    ('ConfigVersion', 'Jenkins'),
E                    ('DiracJobId', 147844677),...
E                 
E                 ...Full output truncated (30 lines hidden), use '-vv' to show

LocalRepo/TestCode/LHCbDIRAC/tests/Integration/BookkeepingSystem/Test_Bookkeeping_MCProds.py:977: AssertionError
========================= 1 failed, 6 passed in 6.32s ==========================

BEGINRELEASENOTES

*BKK

FIX: bkk MC test is a bit less strict about timestamp comparison

ENDRELEASENOTES

Merge request reports