Abacn commented on code in PR #41463:
URL: https://github.com/apache/beam/pull/41463#discussion_r4621474197


##########
sdks/java/io/elasticsearch/src/main/java/org/apache/beam/sdk/io/elasticsearch/ElasticsearchIO.java:
##########
@@ -2964,7 +3000,7 @@ private HttpEntity handleRetry(
             Request request = new Request(method, endpoint);
             request.addParameters(params);
             request.setEntity(requestBody);
-            response = restClient.performRequest(request);

Review Comment:
   From gemini:
   
   Of the 17 `@Test` methods added, 11 (65%) pass without the fix (per the PR 
author's own table), 6 extra Docker containers (3 ES + 3 Toxiproxy) are spun up 
per CI run, and 0 of the 17 tests exercise handleRetry() (1 of the 3 modified 
call sites!).
   
   We need to rewrite tests
   
   - "change-detector" test (anti-pattern): testStoppedClientRejectsAllRequests 
(passing without main code change), testStoppedClientIsReplacedOnStartBundle, 
testFailedReplacementIsRetriedOnNextBundle, testRecoversAfterConnectionRefused, 
testRecoversAfterHangingConnections, testRecoversAfterConnectionReset
   
   - unit tests generally should be lite, and shouldn't spin up testcontainers 
(there are violations in current code base though. They should be in "IT" class)
   
   - ~80 lines of internal test harness are copy-pasted almost 
character-for-character between ElasticsearchIOClientRecoveryTest.java and 
ElasticsearchIOOutageTestCommon.java
   
   



-- 
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]

Reply via email to