[ 
https://issues.apache.org/jira/browse/GROOVY-12084?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18088416#comment-18088416
 ] 

ASF GitHub Bot commented on GROOVY-12084:
-----------------------------------------

testlens-app[bot] commented on PR #2605:
URL: https://github.com/apache/groovy/pull/2605#issuecomment-4687271787

   ## 🚨 TestLens detected 1 failed test 🚨
   
   Here is what you can do:
   
   1) Inspect the test failures carefully.
   2) If you are convinced that some of the tests are flaky, you can mute them 
below.
   3) Finally, trigger a rerun by checking the rerun checkbox.
   
   ### Test Summary
   
   | Check | Project/Task | Test | Runs |
   |---|---|---|---|
   | [Build and test / lts \(17, 
macos-latest\)](https://github.com/apache/groovy/actions/runs/27392883365/job/80954057235?pr=2605)
 | :test | ActorTest > testScheduleAtFixedRateCancelStopsFurtherFires\(\) | ❌ |
   
   🏷️ Commit: 6dc5a998ad269928f3b987d4a75d76324553bd87
   ▶️ Tests:  53679 executed
   🟡 Checks: 5/28 completed
   
   ### Test Failures
   
   <details>
   
   <summary><strong>ActorTest > 
testScheduleAtFixedRateCancelStopsFurtherFires()</strong> (:test in <a 
href="https://github.com/apache/groovy/actions/runs/27392883365/job/80954057235?pr=2605";>Build
 and test / lts (17, macos-latest)</a>)</summary>
   
   ```
   java.lang.AssertionError: expected 2 or 3 ticks (got 4). Expression: (n in 
[2, 3]). Values: n = 4
        at 
org.codehaus.groovy.runtime.InvokerHelper.createAssertError(InvokerHelper.java:402)
        at TestScript20.run(TestScript20.groovy:28)
        at groovy.lang.GroovyShell.evaluate(GroovyShell.java:553)
        at groovy.lang.GroovyShell.evaluate(GroovyShell.java:588)
        at groovy.lang.GroovyShell.evaluate(GroovyShell.java:572)
        at groovy.test.GroovyAssert.assertScript(GroovyAssert.java:106)
        at groovy.test.GroovyAssert.assertScript(GroovyAssert.java:96)
        at 
groovy.concurrent.ActorTest.testScheduleAtFixedRateCancelStopsFurtherFires(ActorTest.groovy:1372)
   ```
   
   </details>
   
   ### Muted Tests
   > [!NOTE]
   > Checks are currently running using the configuration below.
   
   Select tests to mute in this pull request:
   
   🔲 ActorTest > testScheduleAtFixedRateCancelStopsFurtherFires\(\) <!

> groovy-contracts: @Synchronized method with @Ensures/@Invariant but no 
> @Requires throws ClassCastException (SynchronizedStatement → BlockStatement)
> ---------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: GROOVY-12084
>                 URL: https://issues.apache.org/jira/browse/GROOVY-12084
>             Project: Groovy
>          Issue Type: Bug
>          Components: groovy-contracts
>            Reporter: Paul King
>            Assignee: Paul King
>            Priority: Major
>
> This code:
> {code:groovy}
> import groovy.contracts.*
> class A {
>     @groovy.transform.Synchronized
>     //@Requires({ a >= 0 })
>     @Ensures({ a >= 0 })
>     def m(int a) { return a}
> }
> def a = new A()
> a.m(12)
> {code}
> Gives this error:
> {noformat}
> Exception thrown
> BUG! exception in phase 'instruction selection' in source unit 
> 'ConsoleScript6' class org.codehaus.groovy.ast.stmt.SynchronizedStatement 
> cannot be cast to class org.codehaus.groovy.ast.stmt.BlockStatement 
> (org.codehaus.groovy.ast.stmt.SynchronizedStatement and 
> org.codehaus.groovy.ast.stmt.BlockStatement are in unnamed module of loader 
> org.codehaus.groovy.tools.RootLoader @6e0be858)
>       at 
> org.codehaus.groovy.control.CompilationUnit$ISourceUnitOperation.doPhaseOperation(CompilationUnit.java:980)
>         ...
> {noformat}
> It runs fine if the @Requires is present.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to