Page MenuHomePhabricator

test_producer_failure of tools_threading_tests.BasicThreadedGeneratorTestCase fails for GraalPy
Closed, ResolvedPublicBUG REPORT

Description

See https://github.com/wikimedia/pywikibot/actions/runs/34502243118/job/102956033209 for example.

_____________ BasicThreadedGeneratorTestCase.test_producer_failure _____________

self = <tests.tools_threading_tests.BasicThreadedGeneratorTestCase testMethod=test_producer_failure>

    def test_producer_failure(self) -> None:
        """Test producer failures reach consumers after queued results."""
        values = (1, 2, 3)
        failure = ValueError('producer failed')
    
        def generate():
            yield from values
            raise failure
    
>       self._check_failure(generate, values, failure)

tests/tools_threading_tests.py:62: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/tools_threading_tests.py:90: in _check_failure
    self.assertEqual(received, list(values))
E   AssertionError: Lists differ: [] != [1, 2, 3]
E   
E   Second list contains 3 additional elements.
E   First extra element 0:
E   1
E   
E   - []
E   + [1, 2, 3]

Test was introduced with rPWBCbc6012e. I guess that this is not a regression but not tested previously.

Event Timeline

Xqt triaged this task as High priority.Fri, Sep 11, 11:16 AM
Xqt moved this task from Backlog to Test failures on the Pywikibot-tests board.

Change #1339810 had a related patch set uploaded (by Mahveotm; author: Mahveotm):

[pywikibot/core@master] tests: Preserve threaded generator results on failure

https://gerrit.wikimedia.org/r/1339810

Mahveotm changed the task status from Open to In Progress.Fri, Sep 11, 4:05 PM

Change #1339810 merged by jenkins-bot:

[pywikibot/core@master] tests: Preserve threaded generator results on failure

https://gerrit.wikimedia.org/r/1339810

Mahveotm claimed this task.