Uploaded image for project: 'CDI TCK'
  1. CDI TCK
  2. CDITCK-219

SessionContextTest.testSessionContextDestroyedWhenHttpSessionTimesOut uses too short of a sleep delay time

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 1.0.5.CR1, 1.1.0.Alpha2
    • 1.0.4.Final
    • Tests
    • None

      The following test case:

      org.jboss.jsr299.tck.tests.context.session.SessionContextTest.testSessionContextDestroyedWhenHttpSessionTimesOut

      uses the following line to sleep after asking the application server to invalidate the session:

      " Thread.sleep(1500);"

      The test attempts to verify that the session context is destroyed properly after the timeout.

      The problem with this test is that it appears as if it could potentially introduce a timing problem. Since Thread.sleep() behaves slightly differently for each platform, and as far as I can tell is not even guaranteed to sleep as long as requested in some situations, there is a chance that the client may make the second request before 1.5 seconds has expired. Since the behavior of System.getTimeMillis() is also system-dependent, I'd be inclined to think that 1.5 seconds is probably not a long enough timeout in order to keep this test from having intermittent failures.

      I request that this test case be excluded, and that this test be modified in a later version of the TCK to use a larger sleep value.

              mkouba@redhat.com Martin Kouba
              bobnettleton Bob Nettleton (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: