Skip to content

Commit

Permalink
SNOW-990009: Fix flaky test ResultSetLatestIT.testMetadataAPIMetricCo…
Browse files Browse the repository at this point in the history
…llection (#1596)
  • Loading branch information
sfc-gh-dprzybysz authored Jan 4, 2024
1 parent 00e1d0e commit 795107e
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import java.nio.ByteBuffer;
import java.sql.*;
import java.util.*;
import java.util.concurrent.ExecutionException;
import java.util.regex.Pattern;
import net.snowflake.client.ConditionalIgnoreRule;
import net.snowflake.client.RunningOnGithubAction;
Expand Down Expand Up @@ -166,9 +167,12 @@ public void testChunkDownloaderSetRetry() throws SQLException {
* Metadata API metric collection. The old driver didn't collect metrics.
*
* @throws SQLException arises if any exception occurs
* @throws ExecutionException arises if error occurred when sending telemetry events
* @throws InterruptedException arises if error occurred when sending telemetry events
*/
@Test
public void testMetadataAPIMetricCollection() throws SQLException {
public void testMetadataAPIMetricCollection()
throws SQLException, ExecutionException, InterruptedException {
Connection con = init();
Telemetry telemetry =
con.unwrap(SnowflakeConnectionV1.class).getSfSession().getTelemetryClient();
Expand All @@ -195,7 +199,8 @@ public void testMetadataAPIMetricCollection() throws SQLException {
assertNull(parameterValues.get("specific_name_pattern").textValue());

// send data to clear log for next test
telemetry.sendBatchAsync();
telemetry.sendBatchAsync().get();
assertEquals(0, ((TelemetryClient) telemetry).logBuffer().size());

String catalog = con.getCatalog();
String schema = con.getSchema();
Expand Down

0 comments on commit 795107e

Please sign in to comment.