rocketmq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ding...@apache.org
Subject [rocketmq] branch develop updated: fix(test):temporary fix on Mac OS when pid greater than short type max value (#2492)
Date Tue, 08 Dec 2020 06:37:16 GMT
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 <jinrongtong5@163.com>
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);
     }


Mime
View raw message