libvips / libvips/pyvips

BUG: TestProgress::test_progress is flaky due to race condition

Open
#566 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
812
Forks
63
Avg merge
13h 12m
Merged PRs (30d)
2

Description

While building on nixpkgs' CI ("Hydra"), test_progress fails intermittently:

=================================== FAILURES ===================================
__________________________ TestProgress.test_progress __________________________

self = <tests.test_progress.TestProgress object at 0x1104830b0>

    def test_progress(self):
        seen_preeval = False
        seen_eval = False
        seen_posteval = False
    
        def preeval_cb(image, progress):
            nonlocal seen_preeval
            seen_preeval = True
    
        def eval_cb(image, progress):
            nonlocal seen_eval
            seen_eval = True
    
        def posteval_cb(image, progress):
            nonlocal seen_posteval
            seen_posteval = True
    
        image = pyvips.Image.black(1, 100000)
        image.set_progress(True)
        image.signal_connect('preeval', preeval_cb)
        image.signal_connect('eval', eval_cb)
        image.signal_connect('posteval', posteval_cb)
        image.avg()
    
        assert seen_preeval
>       assert seen_eval
E       assert False

tests/test_progress.py:34: AssertionError

Suggested fix: Mark as flaky.

Contributor guide

No contributing guide indexed for this repository

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 in tests/test_progress.py at TestProgress.test_progress and review the intermittent assertion failure shown in the issue. Apply the suggested flaky-test marking, then run the targeted test and verify that the test suite or CI no longer treats this race as a failure.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
testing-qa
Issue type
Bug
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.