From 48f076f20a558a7014c87c268e2a00833518c3e4 Mon Sep 17 00:00:00 2001 From: rongtong Date: Tue, 8 Dec 2020 14:36:55 +0800 Subject: [PATCH] fix(test):temporary fix on Mac OS when pid greater than short type max value (#2492) --- .../rocketmq/common/message/MessageClientIDSetterTest.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/common/src/test/java/org/apache/rocketmq/common/message/MessageClientIDSetterTest.java b/common/src/test/java/org/apache/rocketmq/common/message/MessageClientIDSetterTest.java index 6d8c2038..0a17c36b 100644 --- a/common/src/test/java/org/apache/rocketmq/common/message/MessageClientIDSetterTest.java +++ b/common/src/test/java/org/apache/rocketmq/common/message/MessageClientIDSetterTest.java @@ -35,12 +35,14 @@ public class MessageClientIDSetterTest { assertThat(ipStr).isEqualTo(ipStrFromID); } + @Test public void testGetPidFromID() { - int pid = UtilAll.getPid(); + // Temporary fix on MacOS + short pid = (short) UtilAll.getPid(); String uniqID = MessageClientIDSetter.createUniqID(); - int pidFromID = MessageClientIDSetter.getPidFromID(uniqID); + short pidFromID = (short) MessageClientIDSetter.getPidFromID(uniqID); assertThat(pid).isEqualTo(pidFromID); } -- GitLab