Skip to content

Commit cc2fa84

Browse files
committed
Migrate Java IT test to Testkit
The following IT test has been replaced by stub test: - `CausalClusteringIT.shouldAllowExistingTransactionToCompleteAfterDifferentConnectionBreaks` -> `Routing.test_should_succeed_when_another_conn_fails_and_discover_using_tx_run`
1 parent 4e92394 commit cc2fa84

File tree

1 file changed

+0
-49
lines changed

1 file changed

+0
-49
lines changed

driver/src/test/java/org/neo4j/driver/stress/CausalClusteringIT.java

Lines changed: 0 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@
5959
import org.neo4j.driver.internal.cluster.RoutingSettings;
6060
import org.neo4j.driver.internal.retry.RetrySettings;
6161
import org.neo4j.driver.internal.security.SecurityPlanImpl;
62-
import org.neo4j.driver.internal.util.FailingConnectionDriverFactory;
6362
import org.neo4j.driver.internal.util.FakeClock;
6463
import org.neo4j.driver.internal.util.ThrowingMessageEncoder;
6564
import org.neo4j.driver.internal.util.io.ChannelTrackingDriverFactory;
@@ -430,48 +429,6 @@ void shouldRespectMaxConnectionPoolSizePerClusterMember()
430429
}
431430
}
432431

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-
475432
@Test
476433
void shouldKeepOperatingWhenConnectionsBreak() throws Exception
477434
{
@@ -530,12 +487,6 @@ private void assertRoutingNotAvailableOnReadReplica()
530487
assumeFalse( driver.supportsMultiDb() );
531488
}
532489

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-
539490
private CompletionStage<List<RecordAndSummary>> combineCursors( ResultCursor cursor1,
540491
ResultCursor cursor2 )
541492
{

0 commit comments

Comments
 (0)