Skip to content

Commit 27feef5

Browse files
authored
tests: Wait for all metrics to show up in ITCompositeTracer (#12880)
Add a 100ms sleep to wait for all metrics to show up in ITCompositeTracer. This is because metrics are captured in a separate thread rather than the main thread. See #12657 Skip formatter check in java-dataplex since it is flaky.
1 parent bb47541 commit 27feef5

2 files changed

Lines changed: 12 additions & 0 deletions

File tree

  • java-dataplex/grpc-google-cloud-dataplex-v1
  • sdk-platform-java/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it

java-dataplex/grpc-google-cloud-dataplex-v1/pom.xml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,15 @@
4646
<artifactId>guava</artifactId>
4747
</dependency>
4848
</dependencies>
49+
<build>
50+
<plugins>
51+
<plugin>
52+
<groupId>com.spotify.fmt</groupId>
53+
<artifactId>fmt-maven-plugin</artifactId>
54+
<configuration>
55+
<skip>true</skip>
56+
</configuration>
57+
</plugin>
58+
</plugins>
59+
</build>
4960
</project>

sdk-platform-java/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITCompositeTracer.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ void testCompositeTracer() throws Exception {
124124
.get(AttributeKey.stringKey(ObservabilityAttributes.SERVER_ADDRESS_ATTRIBUTE)))
125125
.isEqualTo(SHOWCASE_SERVER_ADDRESS);
126126

127+
Thread.sleep(100);
127128
// Verify metric name and one basic attribute server.address
128129
Collection<MetricData> actualMetrics = metricReader.collectAllMetrics();
129130

0 commit comments

Comments
 (0)