You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by GitBox <gi...@apache.org> on 2021/12/02 18:55:46 UTC

[GitHub] [beam] chamikaramj commented on a change in pull request #16096: [BEAM-13288] improve logging for no rows present error

chamikaramj commented on a change in pull request #16096:
URL: https://github.com/apache/beam/pull/16096#discussion_r761363810



##########
File path: sdks/java/io/google-cloud-platform/src/test/java/org/apache/beam/sdk/io/gcp/bigquery/BigQueryServicesImplTest.java
##########
@@ -1091,6 +1092,52 @@ public void testFailInsertOtherRetry() throws Exception {
     verifyWriteMetricWasSet("project", "dataset", "table", "actually forbidden", 1);
   }
 
+  /** Tests that {@link DatasetServiceImpl#insertAll} logs suggested remedy for insert timeouts. */
+  @Test
+  public void testInsertTimeoutLog() throws Exception {
+    TableReference ref =
+        new TableReference().setProjectId("project").setDatasetId("dataset").setTableId("table");
+    List<FailsafeValueInSingleWindow<TableRow, TableRow>> rows = new ArrayList<>();
+    rows.add(wrapValue(new TableRow()));
+
+    setupMockResponses(
+        response -> {
+          when(response.getStatusCode()).thenReturn(400);
+          when(response.getContentType()).thenReturn(Json.MEDIA_TYPE);
+          when(response.getContent())
+              .thenReturn(
+                  toStream(errorWithReasonAndStatus("No rows present in the request.", 400)));

Review comment:
       Nit: let's pad this string in the front and back to better check "e.getMessage().contains".




-- 
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: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org