-
-
Notifications
You must be signed in to change notification settings - Fork 18.6k
BUG: off-by-one when doing network test repeats #4485
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
Conversation
thanks for catching this, can you hook up travis ci |
@@ -816,7 +816,7 @@ def network_wrapper(*args, **kwargs): | |||
except SkipTest: | |||
raise | |||
except Exception as e: | |||
if runs < num_runs: | |||
if runs < num_runs - 1: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think if runs <= num_runs:
is clearer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure how that would help, or did I miss something?
In [6]: 0 < 2
Out[6]: True
In [7]: 1 < 2
Out[7]: True
In [8]: 0 <= 2
Out[8]: True
In [9]: 1 <= 2
Out[9]: True
In [10]: 0 < 2 -1
Out[10]: True
In [11]: 1 < 2 -1
Out[11]: False
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
whoops, sorry, you're right...don't know what i was thinking
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No worries, two hard problems in computer science, cache invalidation and naming things and off-by-one errors.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@esc haha - very clever :)
Not sure what to do about the Travis error though. |
Think it has been failing all along, but unnoticed. |
this is marked as issue #4427 (the failing test), which was reported..... |
My guess is, it should look like 46f6c43 |
I see, well in that case, let's just ignore the fix I made? |
@esc your fix is good; was just linking the issue that needs to be fixed (your are fixing the test that was not catching this issue) thxs! |
Doesn't fail on |
That test needs prob just needs to come out...it really just needs to check that the reader 'works', rather than comparing a value which gets revised (and of course they don't tell you that!) |
I'm +>9000 on removing that test! |
@esc why don't u put a skip test in the failing test that you uncovered |
btw - the original PR is a nice object lesson for why tests are important for correct code 😅 |
And now I get this one: |
|
its ok unrelated 2 u |
So I am now skipping the unstable test. Problem is that Python 2.6 |
yes rebase onto master |
@esc just |
@@ -359,6 +359,7 @@ def test_read_famafrench(self): | |||
|
|||
class TestFred(unittest.TestCase): | |||
@network | |||
@unittest.skip('Skip as this is unstable #4427 ') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just change the first line of this function to be raise nose.SkipTest("Test is unstable #4427")
@esc how's this coming? |
Okay, worked out how to skip the test properly. gonna rebase and then it'll be ready to merge. |
Imagine num_runs is two, then runs will take on the values [0, 1] and runs < num_uns will always be False. Hence any genuine Exception the code might raise will be silently ignored and just printed.
The test is unstable and although this makes it work properly, no one knows how long. Hence it was decided to skip this guy until further notice. See also: #4427
Rebased onto current master, please merge. |
@esc can you add a skip test to test_fred_nan and test_fred_parts? Then we can merge this. Going to open an issue that they need to be fixed. |
Also added two skip tests for other fred tests in addition to @esc's work.
Merged (I added two more skip tests for Fred). Thanks! |
Thanks for adding the missing skips and for merging! |
Imagine num_runs is two, then runs will take on the values [0, 1] and runs <
num_uns will always be False. Hence any genuine Exception the code might
raise will be silently ignored and just printed.