Skip to content

Workstealing can lead to deadlocks #3945

@leonard84

Description

@leonard84

Steps to reproduce

This does not work every time as it is dependent on multiple factors.

  • Checkout spockframework/spock@b69f9f1
  • run ./gradlew :spock-specs:test --rerun -Dvariant=3.0 -DjavaVersion=21
  • You might need to try a few times. This depends a bit on your machine, but if it takes longer than 5m then it is most likely stuck.
  • You can attach a debugger to inspect the current executing tests

What is Broken?

As you can see in these two screenshots we switch from executing MockSpecInfoAnnotationSpec to ByteBuddyMockFactoryConcurrentSpec due to workstealing. The problem is that MockSpecInfoAnnotationSpec holds a read-lock for the org.junit.platform.engine.support.hierarchical.ExclusiveResource.GLOBAL_KEY but ByteBuddyMockFactoryConcurrentSpec needs a write-lock.

image
image

Context

  • Used versions (Jupiter/Vintage/Platform): 5.11.0/5.12.0-SNAPSHOT
  • Build Tool/IDE: Gradle

Deliverables

  • ...

Metadata

Metadata

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions