[weld-issues] [JBoss JIRA] Commented: (CDITCK-108) testApplicationScopeActiveDuringCallToEjbTimeoutMethod TCK test relies on threads sleeping

David Blevins (JIRA) jira-events at lists.jboss.org
Mon Jun 13 10:07:23 EDT 2011


    [ https://issues.jboss.org/browse/CDITCK-108?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12608217#comment-12608217 ] 

David Blevins commented on CDITCK-108:
--------------------------------------

I haven't had a chance to investigate how this may impact CDITCK-155 and CDITCK-156, but this test will fail for thread safety issues occasionally.

Bottom line is that waiting on either {{climbed}} or {{descended}} just tests that the timeout method was entered but does not guarantee the end of the method was reached and the proper state was set in the other variables.

Maybe adjust the timeout method like this so that when either climbed or descended are set to true the other variables are also in a testable state.

{code}
   @Timeout
   public void timeout(Timer timer)
   {
      if (beanManager.getContext(ApplicationScoped.class).isActive())
      {
         applicationScopeActive = true;
         if (beanId > 0.0)
         {
            if (beanId == simpleApplicationBeanInstance.get().getId())
            {
               sameBean = true;
            }
         }
         else
         {
            beanId = simpleApplicationBeanInstance.get().getId();
         }
      }

      // applicationScopeActive, beanId and sameBean have been set and are testable
      if (timer.getInfo().equals(CLIMB_COMMAND))
      {
         climbed = true;
      }
      if (timer.getInfo().equals(DESCEND_COMMAND))
      {
         descended = true;
      }
   }
{code}



> testApplicationScopeActiveDuringCallToEjbTimeoutMethod TCK test relies on threads sleeping
> ------------------------------------------------------------------------------------------
>
>                 Key: CDITCK-108
>                 URL: https://issues.jboss.org/browse/CDITCK-108
>             Project: CDI TCK
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>          Components: Tests
>    Affects Versions: 1.0.1.CR1
>            Reporter: Martin Gencur
>            Assignee: Pete Muir
>             Fix For: 1.0.1.Final, 1.1.0.CR1
>
>
> Reliance on timing causes issues, find another way to test.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the weld-issues mailing list