smiklosovic commented on code in PR #2649:
URL: https://github.com/apache/cassandra/pull/2649#discussion_r1311224412
##########
test/unit/org/apache/cassandra/streaming/async/StreamingInboundHandlerTest.java:
##########
@@ -105,13 +108,53 @@ public void
StreamDeserializingTask_deriveSession_StreamInitMessage()
}
@Test (expected = UnsupportedOperationException.class)
- public void StreamDeserializingTask_deriveSession_NoSession()
+ public void StreamDeserializingTask_deriveSession_NoSession() throws
Exception
{
CompleteMessage msg = new CompleteMessage();
StreamDeserializingTask task = new StreamDeserializingTask(null,
streamingChannel, MessagingService.current_version);
task.deriveSession(msg);
}
+ @Test
+ public void StreamDeserializingTask_deriveSession_BulkLoad_Disabled()
+ {
+ try
+ {
+ Guardrails.instance.setBulkLoadEnabled(false);
+ StreamInitMessage msg = new StreamInitMessage(REMOTE_ADDR, 0,
nextTimeUUID(), StreamOperation.BULK_LOAD, nextTimeUUID(), PreviewKind.ALL);
+ StreamDeserializingTask task = new StreamDeserializingTask(null,
streamingChannel, MessagingService.current_version);
+ Assertions.assertThatThrownBy(() -> task.deriveSession(msg))
+ .isInstanceOf(StreamReceiveException.class)
+ .cause()
+ .isInstanceOf(RuntimeException.class)
+ .hasNoCause()
+ .hasMessage("Bulk load is disabled")
+ .as("Derive session should fail");
+ }
+ finally
+ {
+ Guardrails.instance.setBulkLoadEnabled(true);
+ }
+ }
+
+ @Test
+ public void
StreamDeserializingTask_deriveSession_BulkLoad_Disabled_Do_Not_Affect_Non_Bulk_Streaming()
throws Exception
Review Comment:
should be actually `Disabled_Does_Not_Affect`
Do_Not -> Does_Not
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]