Details

    • Type: Task
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 5.8.0.Beta2
    • Component/s: tests
    • Labels:
      None

      Description

      We have some tests that have to assert a certain condition was reached, but this condition being reached is the result of an asynchronous work. Thus we end up adding sleeps before assertions, in order to give that asynchronous work some time to execute.

      As it happens, our CI is quite slow (and getting slower...), so the timeouts we defined are not enough. This leads to some tests failing unexpectedly, for instance JMS tests.

      We should try to find a solution that will prevent us to wait too long on quick machines, and degrade gracefully to longer waiting times on slower machines. Something like the step waiting we have in the JGroups tests:

                             boolean failed = true;
                             for ( int i = 0; i < MAX_WAITS; i++ ) {
                                     //need to sleep for the message consumption
                                     Thread.sleep( NETWORK_WAIT_MILLISECONDS );
                                     if ( result.size() == 1 ) { //the condition we're waiting for
                                             failed = false;
                                             break; //enough time wasted
                                     }
                             }
      
                             if ( failed ) {
                                     Assert.fail( "Waited for long and still Peter Pan didn't fly in!" );
                             }
      

        Attachments

          Activity

            People

            • Assignee:
              yrodiere Yoann Rodière
              Reporter:
              yrodiere Yoann Rodière
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: