File tree Expand file tree Collapse file tree 1 file changed +17
-13
lines changed
modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp Expand file tree Collapse file tree 1 file changed +17
-13
lines changed Original file line number Diff line number Diff line change @@ -47,12 +47,27 @@ public class MultiDataCenterRignTest extends GridCommonAbstractTest {
4747 /** */
4848 @ Test
4949 public void testRing () throws Exception {
50+ int cnt = 10 ;
51+
52+ generateRandomDcCluster (cnt );
53+
54+ assertEquals (cnt , grid (0 ).cluster ().nodes ().size ());
55+
56+ checkSwitches (2 );
57+
58+ stopGrid (cnt - 1 );
59+ stopGrid (0 );
60+
61+ assertEquals (cnt - 2 , grid (1 ).cluster ().nodes ().size ());
62+
63+ checkSwitches (2 );
64+ }
65+
66+ private void generateRandomDcCluster (int cnt ) throws Exception {
5067 ThreadLocalRandom rnd = ThreadLocalRandom .current ();
5168
5269 boolean order = rnd .nextBoolean ();
5370
54- int cnt = 10 ;
55-
5671 for (int i = 0 ; i < cnt ; i += 2 ) {
5772 System .setProperty (IgniteSystemProperties .IGNITE_DATA_CENTER_ID , order ? DC_ID_0 : DC_ID_1 );
5873
@@ -64,17 +79,6 @@ public void testRing() throws Exception {
6479 }
6580
6681 waitForTopology (cnt );
67-
68- assertEquals (cnt , grid (rnd .nextInt (cnt )).cluster ().nodes ().size ());
69-
70- checkSwitches (2 );
71-
72- stopGrid (cnt - 1 );
73- stopGrid (0 );
74-
75- assertEquals (cnt - 2 , grid (rnd .nextInt (cnt )).cluster ().nodes ().size ());
76-
77- checkSwitches (2 );
7882 }
7983
8084 /** */
You can’t perform that action at this time.
0 commit comments