This is an automated email from the ASF dual-hosted git repository.
dinglei pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/rocketmq.git
The following commit(s) were added to refs/heads/develop by this push:
new 48f076f fix(test):temporary fix on Mac OS when pid greater than short
type max value (#2492)
48f076f is described below
commit 48f076f20a558a7014c87c268e2a00833518c3e4
Author: rongtong <[email protected]>
AuthorDate: Tue Dec 8 14:36:55 2020 +0800
fix(test):temporary fix on Mac OS when pid greater than short type max
value (#2492)
---
.../apache/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 6d8c203..0a17c36 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);
}