Skip to content

Commit 956a47b

Browse files
Fixed flaky test: org.apache.dubbo.common.bytecode.WrapperTest.est_getMethodNames_ContainExtendsParentMethods (#15683)
1 parent b869c2c commit 956a47b

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

dubbo-common/src/test/java/org/apache/dubbo/common/bytecode/WrapperTest.java

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818

1919
import org.apache.dubbo.common.utils.ClassUtils;
2020

21+
import java.util.Arrays;
22+
2123
import org.junit.jupiter.api.Assertions;
2224
import org.junit.jupiter.api.Test;
2325
import org.slf4j.Logger;
@@ -179,9 +181,14 @@ void test_getDeclaredMethodNames_ContainExtendsParentMethods() throws Exception
179181

180182
@Test
181183
void test_getMethodNames_ContainExtendsParentMethods() throws Exception {
182-
assertArrayEquals(
183-
new String[] {"hello", "world"}, Wrapper.getWrapper(Son.class).getMethodNames());
184-
assertArrayEquals(new String[] {"hello", "world"}, ClassUtils.getMethodNames(Son.class));
184+
String[] methodNamesFromWrapepr = Wrapper.getWrapper(Son.class).getMethodNames();
185+
String[] methodNamesFromClassUtils = ClassUtils.getMethodNames(Son.class);
186+
187+
Arrays.sort(methodNamesFromWrapepr);
188+
Arrays.sort(methodNamesFromClassUtils);
189+
190+
assertArrayEquals(new String[] {"hello", "world"}, methodNamesFromWrapepr);
191+
assertArrayEquals(new String[] {"hello", "world"}, methodNamesFromClassUtils);
185192
}
186193

187194
@Test

0 commit comments

Comments
 (0)