Pattern selector

Most relevant patterns first. Most helpful ones displayed. Click here to show all.

  1. Method.invoke() has thrown an AssertionError
    Java Runtime
    0
    0
    0
  2. JUnit test assertion failed
    JUnit
    178
    2911
    155

Your stack trace compared to the selected pattern

Jump to solutionsExpand frames
java.lang.AssertionError: There are still nodes recoverying - waited for 30 seconds at __randomizedtesting.SeedInfo.seed( [3E324A3A3D5047B3:BFD4C4224A0F278F] :0)
    at org.junit.Assert.fail(Assert.java:93)
    at org.apache.solr.cloud.AbstractDistribZkTestBase.waitForRecoveriesToFinish(AbstractDistribZkTestBase.java:172)
    at org.apache.solr.cloud.AbstractFullDistribZkTestBase.waitForRecoveriesToFinish(AbstractFullDistribZkTestBase.java:707)
    at org.apache.solr.cloud.AbstractFullDistribZkTestBase.waitForThingsToLevelOut(AbstractFullDistribZkTestBase.java:1492)
6 frames hidden

Solution

chinthana10 months ago

AssertionError is thrown when using JUnit's internal assertions methods compare two different values and those are not equal. Also, the developer can invoke the method when the test logic fails.

The simplest code to reproduce the error is the following:

import static org.junit.Assert.fail;

public class FailTest { 

   @Test 
   public void shouldAssertFail() { 
      ...
      if( ... ) {
         fail("Any message");
      }
   } 
}

Mind the static import. The fail is part of the JUnit API.

Your best course of action is to use the debugger to see why the test is failing and what is the condition that is not being met.

External results for this pattern (10)

  1. cdjacksonvia GitHub17 hours ago
    198.75
    Show stack trace
  2. jenstroegervia GitHub17 hours ago
    The warning results do not match expected:<[MessageId.PKG_012, MessageId.OPF_061, MessageId.OPF_003, MessageId.PKG_012]> but was:<[MessageId.OPF_003, MessageId.PKG_012, MessageId.OPF_061, MessageId.PKG_012]>
    Show stack trace
  3. BO41via GitHub19 hours ago
    expected:<0> but was:<2>
    Show stack trace
  4. hhh0505via GitHub20 hours ago
    expected:<Sun Jan 01 05:00:00 EST 2017> but was:<Sun Jan 01 10:00:00 EST 2017>
    Show stack trace
  5. ejona86via GitHub22 hours ago
  6. ejona86via GitHub22 hours ago
    Window was 131070 expecting 314570
    Show stack trace
  7. ejona86via GitHub22 hours ago
    expected:<0> but was:<1>
    Show stack trace
  8. fenik17via GitHub23 hours ago
    expected:<true> but was:<false>
    Show stack trace
  9. hidekivia GitHub23 hours ago
    expected:<2> but was:<1>
    Show stack trace
  10. hidekivia GitHub23 hours ago
    expected null, but was:<CouchbaseLiteException{domain=1, code=19, msg=null}>
    Show stack trace