facebookarchive/sparts

TestMyTask.test_execute_async is flaky

fmoo opened this issue · 0 comments

fmoo commented

Looks like async periodic task is flaky.

Here's a failure from python3.3 caught by travis.

=================================== FAILURES ===================================
________________________ TestMyTask.test_execute_async _________________________
self = <tests.tasks.test_periodic.TestMyTask testMethod=test_execute_async>
    def test_execute_async(self):
        f = self.task.execute_async()
        res = f.result(3.0)
        self.assertNotNone(res)
        self.assertGreater(res, 0)

        # Verify exception path
        self.task.fail_async = True
        f = self.task.execute_async()
        with self.assertRaises(Exception) as ctx:
>           f.result()
E           AssertionError: Exception not raised
tests/tasks/test_periodic.py:57: AssertionError
----------------------------- Captured stderr call -----------------------------
DEBUG:TestService.MyTask:1422918183.9011364: Execute OK
DEBUG:TestService:All tasks started
DEBUG:TestService:VService Active.  Awaiting graceful shutdown.
DEBUG:TestService.MyTask:1422918183.95128: Execute OK
DEBUG:TestService.MyTask:1422918184.1626158: Execute OK
INFO:TestService:Waiting for tasks to shutdown gracefully...
DEBUG:TestService.MyTask:Thread MyTask exited
DEBUG:TestService:Waiting for <tests.tasks.test_periodic.MyTask object at 0x7fe50451d750> to stop...
=========================== short test summary info ============================
FAIL tests/tasks/test_periodic.py::TestMyTask::test_execute_async
SKIP [1] /home/travis/build/facebook/sparts/tests/test_fb303.py:13: sparts.tests.base.Skip: thrift is required to run this test
SKIP [1] /home/travis/build/facebook/sparts/tests/thrift/test_compiler.py:15: sparts.tests.base.Skip: Unable to find thrift binary on this system
SKIP [1] /home/travis/build/facebook/sparts/tests/tasks/test_thrift.py:15: sparts.tests.base.Skip: Need thrift language bindings to run this test
================ 1 failed, 62 passed, 3 skipped in 5.99 seconds ================
The command "python setup.py test" exited with 1.