jdaugherty commented on PR #3361:
URL: https://github.com/apache/groovy/pull/3361#issuecomment-7166356902

   @paulk-asert could you retrigger the failed `lts (17, macos-latest)` job? 
It's a CI flake unrelated to this change — no test failed (27,355 passed, 0 
failed); the `:groovy-sql:test` task errored before running:
   
   ```
   Execution failed for task ':groovy-sql:test'
   > Could not read path 
'/Users/runner/.groovy/grapes/resolved-caller-all-caller-working70.xml'.
   ```
   
   The same failure hit an unrelated branch on Linux two days ago ([run 
45098713773](https://github.com/apache/groovy/actions/runs/45098713773), 
`:groovy-csv:test`, `...working37.xml`).
   
   **Cause:** a race between two concurrent Test tasks.
   1. With `groovy.grape.bridge-cache=true`, each Test task's `doFirst` copies 
the runner's real `~/.groovy/grapes` into its own grape root 
(`org.apache.groovy-tested.gradle`).
   2. Meanwhile, root `:test` runs `@ForkedJvm` tests that `@Grab` without 
inheriting `grape.root`/`user.home` (`ExtensionModuleTest`, 
`STCExtensionMethodsTest`, `Groovy11046`, the Spock test in 
`TraitASTTransformationTest`), so those child JVMs resolve against the runner's 
real `~/.groovy/grapes`.
   3. Each resolution creates a transient 
`resolved-caller-all-caller-workingNN.xml` and `GrapeIvy` deletes it right 
after. If the bridge copy lists the file and it's gone before being read, 
Gradle fails the task.
   
   **Proposed fix:** Gradle only throws on a vanished file when the copy spec 
would include it, so excluding Ivy's transient files from both bridge copies is 
sufficient:
   
   ```groovy
   exclude '**/*.lck', '**/*.lastUpdated', '**/resolved-caller-*', '**/*.part'
   ```
   
   Optionally, those forked tests could also get `inheritProperties = 
['grape.root', 'user.home']` (as `GrabResolverTest` already has) so they stop 
writing to the real `~/.groovy/grapes` at all.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to