Qcodes icon indicating copy to clipboard operation
Qcodes copied to clipboard

Random timing related test failure on windows

Open jenshnielsen opened this issue 3 years ago • 1 comments

Observed in CI on windows 10

______________________________ test_adjust_timer ______________________________
[gw0] win32 -- Python 3.10.6 C:\hostedtoolcache\windows\Python\3.10.6\x64\python.exe

tektronix_dpo = <TektronixDPO7000xx: dpo>

    def test_adjust_timer(tektronix_dpo):
        """
        After adjusting the type of the measurement or the source of the
        measurement, we need wait at least 0.1 seconds
        ('minimum_adjustment_time') before a measurement value can be
        retrieved. Test this.
        """
    
        timer = timeit.Timer(
            'tektronix_dpo.measurement[0].source1("CH1"),'
            'tektronix_dpo.measurement[0].amplitude()',
            globals=locals(),
        )
        min_time = tektronix_dpo.measurement[0]._minimum_adjustment_time
        repeats = timer.repeat(repeat=10, number=1)
    
        # The minimum time should be at least 95% of the 'minimum_adjustment_time'
>       assert all(t > min_time * 0.95 for t in repeats)
E       assert False
E        +  where False = all(<generator object test_adjust_timer.<locals>.<genexpr> at 0x00000221557F5CB0>)

jenshnielsen avatar Aug 17 '22 04:08 jenshnielsen

Xfailed this test on windows in https://github.com/QCoDeS/Qcodes/pull/4530

jenshnielsen avatar Aug 19 '22 06:08 jenshnielsen