epugh commented on code in PR #4899:
URL: https://github.com/apache/solr/pull/4899#discussion_r4470892632


##########
solr/core/src/test/org/apache/solr/handler/admin/api/SnapshotBackupAPITest.java:
##########
@@ -78,6 +80,45 @@ public void testSuccessfulBackupCommand() throws Exception {
     assertEquals(11, TrackingSnapshotBackupAPI.numberBackupsToKeep.get());
   }
 
+  @Test
+  public void testBackupFailureThrowsInsteadOfReportingErrorOnResponse() {
+    final var backupRequestBody = new ReplicationBackupRequestBody();
+    backupRequestBody.name = "test";
+    backupRequestBody.numberToKeep = 1;
+
+    final var thrown =
+        expectThrows(
+            SolrException.class,
+            () ->
+                new FailingSnapshotBackupAPI(solrCore, 
replicationHandlerConfig)
+                    .createBackup(backupRequestBody));
+    assertEquals(500, thrown.code());
+    assertThat(thrown.getMessage(), containsString("disk is full"));
+  }
+
+  private static class FailingSnapshotBackupAPI extends SnapshotBackupAPI {
+
+    @Inject

Review Comment:
   thanks... fixing



-- 
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]

Reply via email to