groovy
  1. groovy
  2. GROOVY-3981

Spring 2.5.X refresh interval incompatibility

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Critical Critical
    • Resolution: Duplicate
    • Affects Version/s: 1.7.0
    • Fix Version/s: None
    • Component/s: class generator
    • Labels:
      None
    • Environment:
      Groovy 1.7.0, JDK 1.5, Spring 2.5.6, Win
    • Testcase included:
      yes
    • Number of attachments :
      5

      Description

      Version 1.7.0 corrupts Spring 2.5.X refresh interval behaviour. I include set of test proving that. If you run them with Groovy 1.6.5 (see comments containing Groovy 1.6.5, that are necessary to process before running with 1.6.5 - 1.7.0 introduces some changes breaking backward compatibility) all tests pass. With 1.7.0 two fails - one is described in another issue GROOVY-3980.

      This issue should concern with test: com.fg.scripting.groovy.SpringGroovyReloadSupportTest#testReloadLoadGroovyClass

      Note that before running tests, path in com.fg.scripting.groovy.AbstractGroovyTest#setUp must be modified to match your system.

      Spring configuration is so simple, that (I hope) cannot be wrong:

      <?xml version="1.0" encoding="utf-8"?>
      <beans xmlns="http://www.springframework.org/schema/beans"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:lang="http://www.springframework.org/schema/lang"
      xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd http://www.springframework.org/schema/lang http://www.springframework.org/schema/lang/spring-lang.xsd">

      <bean id="propertyPlaceholderConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/>

      <lang:groovy id="mainGroovyClass"
      refresh-check-delay="0"
      script-source="file:$

      {project.build.directory}/target/test-classes/com/fg/mock/MainGroovyClass.groovy"/>

      <lang:groovy id="referencingGroovyClass"
      refresh-check-delay="0"
      script-source="file:${project.build.directory}

      /target/test-classes/com/fg/mock/ReferencingGroovyClass.groovy">
      <lang:property name="mainGroovyClass" ref="mainGroovyClass"/>
      </lang:groovy>

      </beans>

      Bean refreshes to conform to actual source code occurs no more with Groovy 1.7.0.
      Regretfully I wasn't able to find out where problem lies, so no patch is included.

      1. 3633_v17x_Patch.txt
        2 kB
        Roshan Dawrani
      2. v2_3633_v17x_Patch.txt
        0.4 kB
        Roshan Dawrani

        Issue Links

          Activity

          Hide
          Roshan Dawrani added a comment -

          After applying the fix being discussed here, when I ran the failing test (of this JIRA) individually, it runs successfully every single time, but when I run all 16 tests from your code together - intermittently one reload test will fail or another (my desktop is fast too ). Some digging up showed that both pre-post file modification, timestamps were coming as same. A delay in between should help there.

          Show
          Roshan Dawrani added a comment - After applying the fix being discussed here, when I ran the failing test (of this JIRA) individually, it runs successfully every single time, but when I run all 16 tests from your code together - intermittently one reload test will fail or another (my desktop is fast too ). Some digging up showed that both pre-post file modification, timestamps were coming as same. A delay in between should help there.
          Hide
          Jan Novotný added a comment -

          I've modified the tests so that there is a second wait time. Now even on the fastest machines the timestamp must change . Just in case you would like to test it again, Roshan.

          How long do you guess will take to get those bugfixes into the GA release? Which one will it be - 1.7.1?

          Show
          Jan Novotný added a comment - I've modified the tests so that there is a second wait time. Now even on the fastest machines the timestamp must change . Just in case you would like to test it again, Roshan. How long do you guess will take to get those bugfixes into the GA release? Which one will it be - 1.7.1?
          Hide
          Roshan Dawrani added a comment -

          Yes, Jan, the bug fixes will come out only in 1.7.1, which, I have heard from Guillaume, will happen within a month or so.

          In the meanwhile, you have the option to use 1.7.1 snapshot versions.

          Please note that fix for this JIRA (being done by changing GROOVY-3633 fix) is not in the codebase yet, as Jochen wanted Guillaume also to review it.

          Fix for GROOVY-3980 is already checked-in and is available in the snapshot.

          Show
          Roshan Dawrani added a comment - Yes, Jan, the bug fixes will come out only in 1.7.1, which, I have heard from Guillaume, will happen within a month or so. In the meanwhile, you have the option to use 1.7.1 snapshot versions. Please note that fix for this JIRA (being done by changing GROOVY-3633 fix) is not in the codebase yet, as Jochen wanted Guillaume also to review it. Fix for GROOVY-3980 is already checked-in and is available in the snapshot.
          Hide
          Roshan Dawrani added a comment -

          @Jan - this fix is in the 1.7.x codebase now (against GROOVY-3973) and should get released in 1.7.1.

          I tested with your new tests (with the delay) and they seem to be consistently passing now.

          @Jochen - I checked with Guillaume before checking-in the fix.

          Show
          Roshan Dawrani added a comment - @Jan - this fix is in the 1.7.x codebase now (against GROOVY-3973 ) and should get released in 1.7.1. I tested with your new tests (with the delay) and they seem to be consistently passing now. @Jochen - I checked with Guillaume before checking-in the fix.
          Hide
          Jan Novotný added a comment - - edited

          Thank you Roshan - even my internal integration server test fail issue was corrected by the advice you gave me. Looking forward to 1.7.1

          Show
          Jan Novotný added a comment - - edited Thank you Roshan - even my internal integration server test fail issue was corrected by the advice you gave me. Looking forward to 1.7.1

            People

            • Assignee:
              Roshan Dawrani
              Reporter:
              Jan Novotný
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: