Uploaded image for project: 'WildFly'
  1. WildFly
  2. WFLY-12054

Intermittent failures in WebsocketApplicationScopedTestCase

    XMLWordPrintable

Details

    Description

      https://ci.wildfly.org/project.html?projectId=WF_PullRequest&buildTypeId=&tab=testDetails&testNameId=-8608833796003106928&order=TEST_STATUS_DESC&branch_WF_PullRequest=__all_branches__&itemsCount=50

      Problem is this:

      try (Session session = ContainerProvider.getWebSocketContainer().connectToServer(Client.class, uriUser1)) {
                  //Wait until the client is initialized e.q. the OnOpen is executed
                  Thread.sleep(10);
                  Assert.assertTrue(queues.size() > 0);
      

      That kind of pattern of a short sleep followed by an assert is not reliable.

      This should loop checking periodically and only fail after an appropriate amount of time has passed. Unless that amount of time is relevant to what's being tested it should be a long time, 20 secs min, with TimeoutUtil.adjust used.

      Attachments

        Activity

          People

            mmarusic Marek Marusic (Inactive)
            bstansbe@redhat.com Brian Stansberry
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: