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

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

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

   ## 🚨 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
   
   #### [Build and test / lts \(17, 
macos-latest\)](https://github.com/apache/groovy/actions/runs/32009950594/job/95327219435?pr=2801)
 > :test
   
   | Test | Runs | Flakiness |
   |---|---|--:|
   | AgentChangesTest > forAwaitOverChanges\(\) | ❌ | 0% 🟢 |
   
   🏷️ Commit: 257c7f5e8659375d2e46172c057013e0799afe16
   ▶️ Tests:  14576 executed
   🟡 Checks: 2/29 completed
   
   ### Test Failures
   
   <details>
   
   <summary><strong>AgentChangesTest > forAwaitOverChanges()</strong> (:test in 
<a 
href="https://github.com/apache/groovy/actions/runs/32009950594/job/95327219435?pr=2801";>Build
 and test / lts (17, macos-latest)</a>)</summary>
   
   ```
   Assertion failed: 
   
   assert collected == [1, 2, 3]
          |         |
          []        false
   
        at 
org.codehaus.groovy.runtime.InvokerHelper.createAssertError(InvokerHelper.java:401)
        at TestScript0.run(TestScript0.groovy:17)
        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.AgentChangesTest.forAwaitOverChanges(AgentChangesTest.groovy:175)
   ```
   
   </details>
   
   ### Muted Tests
   > [!NOTE]
   > Checks are currently running using the configuration below.
   
   Select tests to mute in this pull request:
   
   🔲 AgentChangesTest > forAwaitOverChanges\(\) <!

> `GroovyCastException: Cannot cast object PojoWrapper` when an as coercion is 
> passed directly as an argument to an anonymous inner class constructor
> ---------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: GROOVY-12232
>                 URL: https://issues.apache.org/jira/browse/GROOVY-12232
>             Project: Groovy
>          Issue Type: Bug
>    Affects Versions: 5.0.8, 5.1.0, 6.0.0-beta-2
>            Reporter: Octavia Togami
>            Assignee: Paul King
>            Priority: Minor
>
> This used to work on Groovy 4.0.33, but fails now on 5.0.8:
> {code:groovy}
> class Test {
>     Test(Set<String> values) {}
> }
> new Test(['a'] as Set) {}
> {code}
> The error is:
> {code:sh}
> GroovyCastException: Cannot cast object 
> 'org.codehaus.groovy.runtime.wrappers.PojoWrapper@47fbc56'
>     with class 'org.codehaus.groovy.runtime.wrappers.PojoWrapper' to class 
> 'java.util.Set'
> {code}
> Without the anon class, coercion (e.g. using {{Set.of(...)}}), if it's stored 
> in a local var first, or if the class constructor is not statically 
> resolvable; it works fine.
> This was reduced from real code in Gradle: 
> https://github.com/gradle/gradle/blob/be7b1d956fd466144fbb3a1e268bfd6704205250/platforms/jvm/java-compiler-worker/src/test/groovy/org/gradle/api/internal/tasks/compile/AnnotationProcessingCompileTaskTest.groovy#L58



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

Reply via email to