jonathan-lemos commented on code in PR #33057:
URL: https://github.com/apache/beam/pull/33057#discussion_r1838467723
##########
runners/core-java/src/test/java/org/apache/beam/runners/core/metrics/StringSetCellTest.java:
##########
@@ -94,4 +99,37 @@ public void testReset() {
assertThat(stringSetCell.getCumulative(), equalTo(StringSetData.empty()));
assertThat(stringSetCell.getDirty(), equalTo(new DirtyState()));
}
+
+ @Test(timeout = 5000)
+ public void testStringSetCellConcurrentAddRetrivial() throws
InterruptedException {
+ StringSetCell cell = new StringSetCell(MetricName.named("namespace",
"name"));
+ AtomicBoolean finished = new AtomicBoolean(false);
+ Thread increment =
+ new Thread(
+ () -> {
+ for (long i = 0; !finished.get(); ++i) {
+ cell.add(String.valueOf(i));
+ try {
+ Thread.sleep(1);
Review Comment:
My mistake. I was thinking Python where it's in seconds and not ms.
--
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]