microsoft / microsoft/Qcodes

Random timing related test failure on windows

Open
#4,519 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug driver
Dominant language
Python
Stars
459
Forks
359
Avg merge
3d 6h
Merged PRs (30d)
73

Description

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>)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the failing test_adjust_timer test and its use of timeit.Timer, _minimum_adjustment_time, and the TektronixDPO measurement fixture. Reproduce the failure on Windows CI and inspect the timing assumptions around this test. Done means the test no longer fails intermittently on Windows while still checking the minimum adjustment time.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
testing-qa
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.