Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove the pinned event example from the documentation #36629

Merged
merged 1 commit into from
Oct 23, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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