Skip to content

Commit 08b4386

Browse files
committed
Reproduce issue
Signed-off-by: Thomas Segismont <tsegismo@ibm.com>
1 parent aa577d0 commit 08b4386

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

hibernate-reactive-core/src/test/java/org/hibernate/reactive/MultithreadedInsertionWithLazyConnectionTest.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ public class MultithreadedInsertionWithLazyConnectionTest {
8181
* this test is also effective in detecting problems with resource starvation.
8282
*/
8383
private static final int N_THREADS = 12;
84-
private static final int ENTITIES_STORED_PER_THREAD = 2000;
84+
private static final int ENTITIES_STORED_PER_THREAD = 20;
8585

8686
//Should finish much sooner, but generating this amount of IDs could be slow on some CIs
8787
public static final int TIMEOUT_MINUTES = 10;
@@ -198,7 +198,9 @@ private CompletionStage<Void> storeEntity(Stage.Session s) {
198198
entity.name = beforeOperationThread + "__" + localVerticleOperationSequence;
199199

200200
return s
201-
.withTransaction( t -> s.persist( entity ) )
201+
.persist(entity)
202+
.thenCompose(v -> s.flush())
203+
.thenAccept(v -> s.clear())
202204
.thenCompose( v -> beforeOperationThread != Thread.currentThread()
203205
? failedFuture( new IllegalStateException( "Detected an unexpected switch of carrier threads!" ) )
204206
: voidFuture() );

0 commit comments

Comments
 (0)