Skip to content

Commit 7106b19

Browse files
committed
Correct retry test case
1 parent 8216d2f commit 7106b19

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/test/java/ru/yandex/clickhouse/util/ClickHouseHttpClientBuilderTest.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
import org.apache.http.client.methods.HttpPost;
66
import org.apache.http.conn.HttpHostConnectException;
77
import org.apache.http.impl.client.CloseableHttpClient;
8+
import org.apache.http.protocol.BasicHttpContext;
9+
import org.apache.http.protocol.HttpContext;
810
import org.testng.annotations.AfterClass;
911
import org.testng.annotations.AfterMethod;
1012
import org.testng.annotations.BeforeClass;
@@ -199,12 +201,14 @@ public void testWithRetry() throws Exception {
199201
// props.setMaxRetries(3);
200202
ClickHouseHttpClientBuilder builder = new ClickHouseHttpClientBuilder(props);
201203
CloseableHttpClient client = builder.buildClient();
204+
HttpContext context = new BasicHttpContext();
205+
context.setAttribute("is_idempotent", Boolean.TRUE);
202206
HttpPost post = new HttpPost("http://localhost:" + server.port() + "/?db=system&query=select%202");
203-
207+
204208
shutDownServerWithDelay(server, 100);
205209

206210
try {
207-
client.execute(post);
211+
client.execute(post, context);
208212
} finally {
209213
client.close();
210214
}

0 commit comments

Comments
 (0)