|
59 | 59 | import org.neo4j.driver.internal.cluster.RoutingSettings;
|
60 | 60 | import org.neo4j.driver.internal.retry.RetrySettings;
|
61 | 61 | import org.neo4j.driver.internal.security.SecurityPlanImpl;
|
62 |
| -import org.neo4j.driver.internal.util.FailingConnectionDriverFactory; |
63 | 62 | import org.neo4j.driver.internal.util.FakeClock;
|
64 | 63 | import org.neo4j.driver.internal.util.ThrowingMessageEncoder;
|
65 | 64 | import org.neo4j.driver.internal.util.io.ChannelTrackingDriverFactory;
|
@@ -430,48 +429,6 @@ void shouldRespectMaxConnectionPoolSizePerClusterMember()
|
430 | 429 | }
|
431 | 430 | }
|
432 | 431 |
|
433 |
| - @Test |
434 |
| - void shouldAllowExistingTransactionToCompleteAfterDifferentConnectionBreaks() |
435 |
| - { |
436 |
| - Cluster cluster = clusterRule.getCluster(); |
437 |
| - |
438 |
| - FailingConnectionDriverFactory driverFactory = new FailingConnectionDriverFactory(); |
439 |
| - |
440 |
| - try ( Driver driver = driverFactory.newInstance( cluster.getRoutingUri(), clusterRule.getDefaultAuthToken(), |
441 |
| - RoutingSettings.DEFAULT, RetrySettings.DEFAULT, configWithoutLogging(), SecurityPlanImpl.insecure() ) ) |
442 |
| - { |
443 |
| - Session session1 = driver.session(); |
444 |
| - Transaction tx1 = session1.beginTransaction(); |
445 |
| - tx1.run( "CREATE (n:Node1 {name: 'Node1'})" ).consume(); |
446 |
| - |
447 |
| - Session session2 = driver.session(); |
448 |
| - Transaction tx2 = session2.beginTransaction(); |
449 |
| - tx2.run( "CREATE (n:Node2 {name: 'Node2'})" ).consume(); |
450 |
| - |
451 |
| - ServiceUnavailableException error = new ServiceUnavailableException( "Connection broke!" ); |
452 |
| - driverFactory.setNextRunFailure( error ); |
453 |
| - assertUnableToRunMoreQueriesInTx( tx2, error ); |
454 |
| - |
455 |
| - tx2.close(); |
456 |
| - tx1.commit(); |
457 |
| - |
458 |
| - try ( Session session3 = driver.session( builder().withBookmarks( session1.lastBookmark() ).build() ) ) |
459 |
| - { |
460 |
| - // tx1 should not be terminated and should commit successfully |
461 |
| - assertEquals( 1, countNodes( session3, "Node1", "name", "Node1" ) ); |
462 |
| - // tx2 should not commit because of a connection failure |
463 |
| - assertEquals( 0, countNodes( session3, "Node2", "name", "Node2" ) ); |
464 |
| - } |
465 |
| - |
466 |
| - // rediscovery should happen for the new write query |
467 |
| - Bookmark session4Bookmark = createNodeAndGetBookmark( driver.session(), "Node3", "name", "Node3" ); |
468 |
| - try ( Session session5 = driver.session( builder().withBookmarks( session4Bookmark ).build() ) ) |
469 |
| - { |
470 |
| - assertEquals( 1, countNodes( session5, "Node3", "name", "Node3" ) ); |
471 |
| - } |
472 |
| - } |
473 |
| - } |
474 |
| - |
475 | 432 | @Test
|
476 | 433 | void shouldKeepOperatingWhenConnectionsBreak() throws Exception
|
477 | 434 | {
|
@@ -530,12 +487,6 @@ private void assertRoutingNotAvailableOnReadReplica()
|
530 | 487 | assumeFalse( driver.supportsMultiDb() );
|
531 | 488 | }
|
532 | 489 |
|
533 |
| - private static void assertUnableToRunMoreQueriesInTx(Transaction tx, ServiceUnavailableException cause ) |
534 |
| - { |
535 |
| - SessionExpiredException e = assertThrows( SessionExpiredException.class, () -> tx.run( "CREATE (n:Node3 {name: 'Node3'})" ).consume() ); |
536 |
| - assertEquals( cause, e.getCause() ); |
537 |
| - } |
538 |
| - |
539 | 490 | private CompletionStage<List<RecordAndSummary>> combineCursors( ResultCursor cursor1,
|
540 | 491 | ResultCursor cursor2 )
|
541 | 492 | {
|
|
0 commit comments