Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test failure in test_train_timeout_subprocess #28

Open
PureTryOut opened this issue May 30, 2020 · 3 comments
Open

Test failure in test_train_timeout_subprocess #28

PureTryOut opened this issue May 30, 2020 · 3 comments

Comments

@PureTryOut
Copy link

On Alpine Linux, some architectures (not all of them, e.g. it works fine on x86_64) seem to fail on test_train_timeout_subprocess:

============================= test session starts ==============================
platform linux -- Python 3.8.3, pytest-5.4.2, py-1.8.1, pluggy-0.13.1
rootdir: /builds/PureTryOut/aports/testing/py3-padatious/src/padatious-0.4.8
collected 36 items

tests/test_all.py ......                                                 [ 16%]
tests/test_container.py ....sF.........                                  [ 58%]
tests/test_entity_edge.py .                                              [ 61%]
tests/test_id_manager.py ....                                            [ 72%]
tests/test_intent.py ..                                                  [ 77%]
tests/test_match_data.py ..                                              [ 83%]
tests/test_train_data.py .                                               [ 86%]
tests/test_util.py .....                                                 [100%]

=================================== FAILURES ===================================
______________ TestIntentContainer.test_train_timeout_subprocess _______________

self = <tests.test_container.TestIntentContainer object at 0xffff8f5d54c0>

    def test_train_timeout_subprocess(self):
        self.cont.add_intent('a', [
            ' '.join(random.choice('abcdefghijklmnopqrstuvwxyz') for _ in range(5))
            for __ in range(300)
        ])
        self.cont.add_intent('b', [
            ' '.join(random.choice('abcdefghijklmnopqrstuvwxyz') for _ in range(5))
            for __ in range(300)
        ])
        a = monotonic()
        assert not self.cont.train_subprocess(timeout=0.1)
        b = monotonic()
>       assert b - a <= 1
E       assert (3178089.64288705 - 3178088.391084973) <= 1

tests/test_container.py:149: AssertionError
=========================== short test summary info ============================
FAILED tests/test_container.py::TestIntentContainer::test_train_timeout_subprocess
=================== 1 failed, 34 passed, 1 skipped in 5.89s ====================

I'd think assert with those values would be less than 1 so equal to true, but maybe it doesn't like the . for some reason?

@MatthewScholefield
Copy link
Collaborator

Hmm, it's definitely doing something it's not supposed to. We see it takes around 1.25 seconds to return even though it has a timeout of 0.1. What are the specs? Perhaps a cpu slowdown caused the parts not wrapped in the timeout to take longer than normal

@PureTryOut
Copy link
Author

Sorry for my late response. I'm not sure what the specs are, this is being ran on the Gitlab CI of Alpine Linux and every architecture is ran on it's own machine.

The failing architectures are x86, ppc64le, armv7 and aarch64.

@ChlorideCull
Copy link

From looking at the code, creating the subprocess and tearing it down won't be part of the timeout, and from experience that can take a not insignificant amount of time, especially on a contested CPU or if an HDD has to load data (the case for me).

I would increase the time difference that's asserted to something like 5 seconds, it's unlikely that a bug will cause it to timeout later, it's more likely that it won't timeout properly at all.

#15 seems related.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants