Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Intermitted error in test_datasaver_scalars

Open
#4,666 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

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

Research direction

Start with the test_datasaver_scalars test shown in the issue and review errorlog.txt for the intermittent failure details. Reproduce the failure under the test's Hypothesis settings, then identify the relevant DataSaver behavior and verify that the test completes reliably with the expected points_written value.

Written by the indexing model from the issue text.

Description

bug
    @settings(max_examples=5, deadline=None,
              suppress_health_check=(HealthCheck.function_scoped_fixture,))
    @given(breakpoint=hst.integers(min_value=1, max_value=19),
           write_period=hst.floats(min_value=0.1, max_value=1.5),
           set_values=hst.lists(elements=hst.floats(), min_size=20, max_size=20),
           get_values=hst.lists(elements=hst.floats(), min_size=20, max_size=20))
    @pytest.mark.usefixtures('set_default_station_to_none')
    def test_datasaver_scalars(experiment, DAC, DMM, set_values, get_values,
                               breakpoint, write_period):
        no_of_runs = len(experiment)
    
        station = qc.Station(DAC, DMM)
    
        meas = Measurement(station=station)
        meas.write_period = write_period
    
        assert meas.write_period == write_period
    
        meas.register_parameter(DAC.ch1)
        meas.register_parameter(DMM.v1, setpoints=(DAC.ch1,))
    
        with meas.run() as datasaver:
            for set_v, get_v in zip(set_values[:breakpoint],
                                    get_values[:breakpoint]):
                datasaver.add_result((DAC.ch1, set_v), (DMM.v1, get_v))
    
            assert datasaver._dataset.number_of_results == 0
            sleep(write_period * 1.1)
            datasaver.add_result((DAC.ch1, set_values[breakpoint]),
                                 (DMM.v1, get_values[breakpoint]))
>           assert datasaver.points_written == breakpoint + 1
E           assert 0 == (1 + 1)
E            +  where 0 = <qcodes.dataset.measurements.DataSaver object at 0x000002006588C8B0>.points_written

See details in the log below.

errorlog.txt

Dominant language
Python
Stars
459
Forks
361
Avg merge
2d 10h
Merged PRs (30d)
79

Getting set up

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.

More from microsoft/Qcodes

All issues in microsoft/Qcodes

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.