Skip to content

Commit

Permalink
Merge pull request #36629 from cescoffier/remove-pinned-event-from-doc
Browse files Browse the repository at this point in the history
Remove the pinned event example from the documentation
  • Loading branch information
ozangunalp authored Oct 23, 2023
2 parents 32f44b5 + 0a68ac9 commit b5ab981
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions docs/src/main/asciidoc/virtual-threads.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,10 @@ When it happens, the test fails.
The `@ShouldNotPin` can also be used on methods directly.

The _junit5-virtual-threads_ also provides a `@ShouldPin` annotation for cases where pinning is unavoidable.
The following snippet demonstrates the `@ShouldPin` annotation usage and the possibility to inject a `ThreadPinnedEvents` instance in your test to verify when the carrier thread was pinned manually.
The following snippet demonstrates the `@ShouldPin` annotation usage.

// This is not possible because of a classloading issue - See https://github.com/quarkusio/quarkus/issues/36569 :
// and the possibility to inject a `ThreadPinnedEvents` instance in your test to verify when the carrier thread was pinned manually.

[source, java]
----
Expand All @@ -548,14 +551,6 @@ public class LoomUnitExampleTest {
codeUnderTest.pin();
}
@Test
public void testThatShouldNotPin(ThreadPinnedEvents events) { // Inject an object to check the pin events
Assertions.assertTrue(events.getEvents().isEmpty());
codeUnderTest.pin();
await().until(() -> events.getEvents().size() > 0);
Assertions.assertEquals(events.getEvents().size(), 1);
}
}
----

Expand Down

0 comments on commit b5ab981

Please sign in to comment.