Skip to content

Conversation

@karajan1001
Copy link
Contributor

This is a flaky, the queue tasks status might remain "Running" even if
it had already been completed, beside sometimes I also noticed it raise
a pytest fixture error.

Thank you for the contribution - we'll try to review it as soon as possible. 🙏

@karajan1001 karajan1001 requested a review from pmrowla August 8, 2022 12:59
@karajan1001 karajan1001 requested a review from a team as a code owner August 8, 2022 12:59
@skshetry
Copy link
Collaborator

skshetry commented Aug 8, 2022

@karajan1001, do you know why this happens? Is there something that we can fix?

@karajan1001
Copy link
Contributor Author

@karajan1001, do you know why this happens? Is there something that we can fix?

Currently not, this behavior happens after I add some other unit test (in which I mocked some methods). Need some detailed investigation.

@karajan1001
Copy link
Contributor Author

karajan1001 commented Aug 9, 2022

One example of fixture setup error.

_________ ERROR at setup of test_modified_data_dep[False-foo: 2-True] __________
[gw0] linux -- Python 3.10.5 /opt/hostedtoolcache/Python/3.10.5/x64/bin/python

request = <FixtureRequest for <Function test_modified_data_dep[False-foo: 2-True]>>

    def fill(request):
        item = request._pyfuncitem
        fixturenames = getattr(item, "fixturenames", None)
        if fixturenames is None:
            fixturenames = request.fixturenames
    
        if hasattr(item, 'callspec'):
            for param, val in sorted_by_dependency(item.callspec.params, fixturenames):
                if val is not None and is_lazy_fixture(val):
                    item.callspec.params[param] = request.getfixturevalue(val.name)
                elif param not in item.funcargs:
>                   item.funcargs[param] = request.getfixturevalue(param)
self = <celery.backends.filesystem.FilesystemBackend object at 0x7fe8dded7880>
task_id = 'bdbf0ab3-eaef-4e8c-8dc5-0ac905a52d1a', timeout = 10.0, interval = 0.5
no_ack = True, on_interval = <promise@0x7fe8dde4c4c0>

    def wait_for(self, task_id,
                 timeout=None, interval=0.5, no_ack=True, on_interval=None):
        """Wait for task and return its result.
    
        If the task raises an exception, this exception
        will be re-raised by :func:`wait_for`.
    
        Raises:
            celery.exceptions.TimeoutError:
                If `timeout` is not :const:`None`, and the operation
                takes longer than `timeout` seconds.
        """
        self._ensure_not_eager()
    
        time_elapsed = 0.0
    
        while 1:
            meta = self.get_task_meta(task_id)
            if meta['status'] in states.READY_STATES:
                return meta
            if on_interval:
                on_interval()
            # avoid hammering the CPU checking status.
            time.sleep(interval)
            time_elapsed += interval
            if timeout and time_elapsed >= timeout:
>               raise TimeoutError('The operation timed out.')
E               celery.exceptions.TimeoutError: The operation timed out.

/opt/hostedtoolcache/Python/3.10.5/x64/lib/python3.10/site-packages/celery/backends/base.py:792: TimeoutError

This is a celery timeout error, and I guess it comes out when the celery starts when we have a heavy CPU load. It can't get enough resources?

@karajan1001 karajan1001 enabled auto-merge (rebase) August 9, 2022 03:23
@skshetry
Copy link
Collaborator

skshetry commented Aug 9, 2022

@karajan1001, is it possible to increase the timeout then?

@daavoo daavoo added A: task-queue testing Related to the tests and the testing infrastructure labels Aug 9, 2022
karajan1001 and others added 2 commits August 9, 2022 17:13
This is a flaky, the queue tasks status might remain "Running" even if
it had already been completed, beside sometimes I also noticed it raise
a pytest fixture error.
@karajan1001 karajan1001 merged commit 7a0b3e9 into treeverse:main Aug 9, 2022
@karajan1001 karajan1001 deleted the flaky_queue_test branch August 9, 2022 11:57
@pmrowla
Copy link
Contributor

pmrowla commented Aug 9, 2022

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

testing Related to the tests and the testing infrastructure

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants