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

Failure of unit-test: testCancelledMismatchFormatting #36

Open
spkrka opened this issue Jan 25, 2019 · 3 comments
Open

Failure of unit-test: testCancelledMismatchFormatting #36

spkrka opened this issue Jan 25, 2019 · 3 comments

Comments

@spkrka
Copy link
Member

spkrka commented Jan 25, 2019

I consistently get this test failure on master build.

Java version:

$ java -version
java version "1.8.0_162"
Java(TM) SE Runtime Environment (build 1.8.0_162-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.162-b12, mixed mode)

Test failure:

testCancelledMismatchFormatting(com.spotify.hamcrest.future.ExceptionallyCompletedBlockingFutureTest)  Time elapsed: 0.003 sec  <<< FAILURE!
java.lang.AssertionError: 
Expected: is "a future that was cancelled"
     but: was "a future that was interrupted"
	at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:18)
	at org.junit.Assert.assertThat(Assert.java:956)
	at org.junit.Assert.assertThat(Assert.java:923)
	at com.spotify.hamcrest.future.ExceptionallyCompletedBlockingFutureTest.testCancelledMismatchFormatting(ExceptionallyCompletedBlockingFutureTest.java:100)
@spkrka
Copy link
Member Author

spkrka commented Jan 25, 2019

This fixes it for me: #35

@spkrka
Copy link
Member Author

spkrka commented Jan 25, 2019

Though that PR doesn't really address the root issue...
If I add assertFalse(Thread.currentThread().isInterrupted()); as the first line of each test, it fails on that itself.

Thus, I think it's a case of test interference since it depends on the interrupted state being unset.

@spkrka
Copy link
Member Author

spkrka commented Jan 25, 2019

Proper fix here instead: #37

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

1 participant