jaketf commented on a change in pull request #11450:
URL: https://github.com/apache/beam/pull/11450#discussion_r413447374
##########
File path:
sdks/java/io/google-cloud-platform/src/test/java/org/apache/beam/sdk/io/gcp/healthcare/HL7v2IOTestUtil.java
##########
@@ -91,10 +92,13 @@ static void deleteAllHL7v2Messages(HealthcareApiClient
client, String hl7v2Store
}
/** Populate the test messages into the HL7v2 store. */
- static void writeHL7v2Messages(HealthcareApiClient client, String
hl7v2Store) throws IOException {
+ static void writeHL7v2Messages(HealthcareApiClient client, String hl7v2Store)
+ throws IOException, InterruptedException {
for (HL7v2Message msg : MESSAGES) {
client.createHL7v2Message(hl7v2Store, msg.toModel());
}
+ // [BEAM-9779] HL7v2 indexing is asyncronous. Add sleep to stabilize this
IT.
+ Sleeper.DEFAULT.sleep(5000);
Review comment:
Great Question!
As the Jira ticket explains I was not able to reproduce the flakiness of the
test locally (I think because it takes long enough for my list request to reach
us-central (from my workstation in Oregon) that the async indexing is complete
(while the jenkins workers are much closer and end up sometimes beating the
indexer to the punch and reading a stale list of messages). I chose 5000 based
on my latency to us-central being well under 5 seconds and a hope that the
indexer doesn't take this long to index 3 measly messages :)
I know the Java Post Commit is already a long check so I didn't want to
unnecessarily sleep for too long.
I'm not sure if the Healthcare API has an SLA or benchmarks for the async
HL7v2 Message indexing.
@lastomato any idea?
I'm happy to bump this value higher, but it's guesswork on my end for how
long we should sleep.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]