You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2014/08/09 19:29:11 UTC

[jira] [Commented] (THRIFT-2657) py.twisted/test_suite.py:ThriftTestCase.testOneway spuriously fails on loaded machines

    [ https://issues.apache.org/jira/browse/THRIFT-2657?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14091827#comment-14091827 ] 

ASF GitHub Bot commented on THRIFT-2657:
----------------------------------------

GitHub user jamesbroadhead opened a pull request:

    https://github.com/apache/thrift/pull/181

    Fix spurious test failures in py:twisted

    - py.twisted/test_suite.py:ThriftTestCase.testOneway relies on
      testOneWay executing in less than 0.04 seconds (since it sleeps for 2
      seconds, then asserts that 2s - <time> ~= 0). On slow, or loaded
      machines this may fail. Switch this to sleep for 1 second, then have a
      tolerance of 0.4s for the deferred resolution.
    
    - Removes a dud return d from testOneWay.
    
    - Remove '*' import & dud 'import random'. This file now passes
      pyflakes.
    
    - Strip trailing whitespace
    
    Jira: THRIFT-2657

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/jamesbroadhead/thrift twisted_spurious_test_failures

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/thrift/pull/181.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #181
    
----
commit aa917a6098b4516deda3a91d33eef6b9bbcd0791
Author: James Broadhead <jb...@twitter.com>
Date:   2014-08-09T17:21:44Z

    Fix spurious test failures in py:twisted
    
    - py.twisted/test_suite.py:ThriftTestCase.testOneway relies on
      testOneWay executing in less than 0.04 seconds (since it sleeps for 2
      seconds, then asserts that 2s - <time> ~= 0). On slow, or loaded
      machines this may fail. Switch this to sleep for 1 second, then have a
      tolerance of 0.4s for the deferred resolution.
    
    - Removes a dud return d from testOneWay.
    
    - Remove '*' import & dud 'import random'. This file now passes
      pyflakes.
    
    - Strip trailing whitespace
    
    Jira: THRIFT-2657

----


> py.twisted/test_suite.py:ThriftTestCase.testOneway spuriously fails on loaded machines 
> ---------------------------------------------------------------------------------------
>
>                 Key: THRIFT-2657
>                 URL: https://issues.apache.org/jira/browse/THRIFT-2657
>             Project: Thrift
>          Issue Type: Bug
>            Reporter: James Broadhead
>            Priority: Minor
>
> py.twisted/test_suite.py:ThriftTestCase.testOneway
> relies on a call to 
> client.testOneway(2)
> taking less than
> 2.005 seconds 
> (2.004 succeeds, because round(2 - 2.004, 2) == 0)
> On a loaded (or slow) machine, this isn't guaranteed. 
> Suggest that the sensitivity of this test be significantly relaxed, unless this is a  test measuring performance (which I do not believe it to be)
>  
> {code}
> ===============================================================================
> [FAIL]
> Traceback (most recent call last):
>   File "/usr/lib64/python2.7/site-packages/twisted/internet/defer.py", line 1070, in _inlineCallbacks
>     result = g.send(result)
>   File "/home/hangfire/checkouts/github/thrift-clean/test/py.twisted/test_suite.py", line 184, in testOneway
>     self.assertAlmostEquals(seconds, (end - start), places=2)
>   File "/usr/lib64/python2.7/site-packages/twisted/trial/_synctest.py", line 472, in assertAlmostEqual
>     % (first, second, places))
> twisted.trial.unittest.FailTest: 2 != 2.0055909156799316 within 2 places
> test_suite.ThriftTestCase.testOneway
> -------------------------------------------------------------------------------
> {code}



--
This message was sent by Atlassian JIRA
(v6.2#6252)