nastra commented on code in PR #8853:
URL: https://github.com/apache/iceberg/pull/8853#discussion_r1362301067


##########
spark/v3.5/spark/src/test/java/org/apache/iceberg/spark/source/SparkSQLExecutionHelper.java:
##########
@@ -42,28 +45,26 @@ public static String lastExecutedMetricValue(SparkSession 
spark, String metricNa
     SQLExecutionUIData lastExecution = statusStore.executionsList().last();
     Option<SQLPlanMetric> sqlPlanMetric =
         lastExecution.metrics().find(metric -> 
metric.name().equals(metricName));
-    Assert.assertTrue(
-        String.format("Metric '%s' not found in last execution", metricName),
-        sqlPlanMetric.isDefined());
+    assertThat(sqlPlanMetric.isDefined())
+        .as(String.format("Metric '%s' not found in last execution", 
metricName))
+        .isTrue();
     long metricId = sqlPlanMetric.get().accumulatorId();
 
     // Refresh metricValues, they will remain null until the execution is 
complete and metrics are
     // aggregated
-    int attempts = 3;
-    while (lastExecution.metricValues() == null && attempts > 0) {
-      try {
-        Thread.sleep(100);
-        attempts--;
-      } catch (InterruptedException e) {
-        throw new RuntimeException(e);
-      }
+    Awaitility.await()

Review Comment:
   in certain cases it makes sense to add an alias, but here I think we should 
be ok, since there's a comment right above that explains what's being done



-- 
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: issues-unsubscr...@iceberg.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org
For additional commands, e-mail: issues-h...@iceberg.apache.org

Reply via email to