This is an automated email from the ASF dual-hosted git repository. jackietien pushed a commit to branch ty/SessionPoolTest in repository https://gitbox.apache.org/repos/asf/iotdb.git
commit a2fc7582e36e8a4f832e8d6e2626a6a26487cb86 Author: JackieTien97 <[email protected]> AuthorDate: Tue Jan 2 14:43:41 2024 +0800 try fix SessionPoolTest UT --- .../java/org/apache/iotdb/session/pool/SessionPoolTest.java | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/iotdb-client/session/src/test/java/org/apache/iotdb/session/pool/SessionPoolTest.java b/iotdb-client/session/src/test/java/org/apache/iotdb/session/pool/SessionPoolTest.java index 7636b4025cc..61ff19bd36b 100644 --- a/iotdb-client/session/src/test/java/org/apache/iotdb/session/pool/SessionPoolTest.java +++ b/iotdb-client/session/src/test/java/org/apache/iotdb/session/pool/SessionPoolTest.java @@ -183,11 +183,20 @@ public class SessionPoolTest { TSStatus closeResp = successStatus; Mockito.when(client.closeOperation(any(TSCloseOperationReq.class))).thenReturn(closeResp); - sessionPool = new SessionPool("host", 11, "user", "password", 5); + sessionPool = + new SessionPool.Builder() + .host("host") + .port(11) + .user("user") + .password("password") + .maxSize(5) + .enableAutoFetch(false) + .build(); + ConcurrentLinkedDeque<ISession> queue = new ConcurrentLinkedDeque<>(); queue.add(session); - // 设置 SessionPool 对象的内部状态 + // set SessionPool's internal field state Whitebox.setInternalState(sessionPool, "queue", queue); }
