reta commented on code in PR #1:
URL:
https://github.com/apache/flink-connector-opensearch/pull/1#discussion_r1035955510
##########
flink-connector-opensearch/src/test/java/org/apache/flink/streaming/connectors/opensearch/OpensearchSinkTest.java:
##########
@@ -79,7 +82,15 @@ public void setUp() throws IOException {
return (req, resp, context) -> resp.setStatusCode(200);
} else if (method.equalsIgnoreCase("POST")) {
// Bulk responses are configured per test case
- return (req, resp, context) ->
responses.poll().accept(resp);
+ return (req, resp, context) -> {
+ lock.lock();
+ try {
+ responses.poll().accept(resp);
+ flushed.signalAll();
Review Comment:
`awaitForCondition` is not checking the flushing part, it is checking the
`numPendingRequest`, which will be eventually updated, for the test it is
sufficient to just know that flush has happened (at least, I don't see the
reasons to complicate this part with per-response latches).
--
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]