-
-
Notifications
You must be signed in to change notification settings - Fork 100
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
NUnit failures on list-ops test #155
Comments
I also had to tweak two more tests where NUnit was failing to compare two large lists:
With those tweaks, the unit tests all passed. This is with NUnit 2.6.3 on Mono 4.2.4 (I downgraded from Mono 4.4 to 4.2 on my main F# dev box because using Mono 4.4 was triggering fsprojects/FAKE#1196, but downgrading Mono to 4.2 fixed that issue). |
@rmunn That is weird. Could you perhaps try it using NUnit 3.2? |
@rmunn Were you able to reproduce this on NUnit 3.2? |
Running it with the NUnit 3.2 console runner, I got a Rather than futz around for hours trying to figure out the intricacies of MSBuild XML files, I then just used Paket: I cloned a new copy of the Project Scaffold, set its Conclusion: It's an NUnit 2 bug that makes it fail when it tries to traverse very large lists to compare them for equality, and this bug has been fixed in NUnit 3. |
@rmunn Thanks for checking! I'll close this issue then. |
Although I agree with closing the issue, I also suggest adding a comment to the unit test(s) that fail with 2.6 saying, "If you find that you get a That way someone else who tries to use NUnit from their Ubuntu system's |
I'm not sure about adding a commented, alternative version of the test. This to me increases confusion. Adding a comment about an exception with NUnit 2.6 is of course a good idea. |
@rmunn One last thing, could you try to run it in NUnit 2.6 with |
After an involuntary reboot (brief power outage), I can't actually get the unit test in the exercise to fail under 2.6 any longer! However, in my dedicated project I set up to test against NUnit 2.6 or 3.2 (using Paket and FAKE to handle the messy details for me), I was still able to reproduce the failure in 2.6. Here are my results:
Total of 997 |
Thanks a lot for testing. It seems to me we have four options:
I don't really like the comment options, as I think that there's a fair chance people might not actually read the test files that closely. My preference is thus for option 1 or 4. |
I wonder how much effort would there be to do 4... |
Not much, I'll do this next week. |
The one drawback to 4 is that if you get something wrong so the unit test fails, you don't get to see what index compared unequal and the values at that index, just that the expected and actual lists weren't equal. But that can easily be solved by a debugger, or by the "poor man's debugging" method of just sticking |
I do like the idea of having something that doesn't crash. |
While working on the
list-ops
exercise, I was getting some failures on afoldr
implementation that I was certain was correct. The failures looked like this:After some troubleshooting, I discovered that my implementation was correct, and the
NullReferenceException
was happening inside NUnit 2.6.3 when it tried to compare two very large F# lists. I was able to prove this by creating a minimal example that fails:This also produces a
NullReferenceException
:By changing the assertion to
Assert.That((l1 = l2), Is.True)
, I was able to make my minimal test case pass rather than throwNullReferenceException
during the comparison.So I replaced the
foldr
tests in thelist-ops
exercise with the following two tests, and NUnit stopped throwingNullReferenceException
s and started passing instead:This loses NUnit's nice list-comparison features where it tells you what items were different and at what index they were found... but this is the only way I've found so far to get the tests to run correctly.
The text was updated successfully, but these errors were encountered: