ivanzlenko commented on code in PR #5200: URL: https://github.com/apache/ignite-3/pull/5200#discussion_r1949365556
########## modules/distribution-zones/src/test/java/org/apache/ignite/internal/distributionzones/rebalance/RebalanceUtilUpdateAssignmentsTest.java: ########## @@ -222,286 +221,148 @@ public void tearDown() { keyValueStorage.close(); } - /** - * Nodes for new assignments calculating: nodes1. - * The table configuration assignments: assignments2. - * Current assignments in the metastorage: stable=null, pending=null, planned=null. - * Expected assignments in the metastorage after updating: stable=null, pending=assignments1, planned=null. - */ - @Test - void test1() { - test( - nodes1, assignments2, - null, null, null, - null, assignments1, null, assignmentsTimestamp - ); - } - - /** - * Nodes for new assignments calculating: nodes1. - * The table configuration assignments: assignments1. - * Current assignments in the metastorage: stable=null, pending=null, planned=null. - * Expected assignments in the metastorage after updating: stable=null, pending=null, planned=null. - */ - @Test - void test2() { - test( - nodes1, assignments1, - null, null, null, - null, null, null, assignmentsTimestamp - ); - } - - /** - * Nodes for new assignments calculating: nodes1. - * The table configuration assignments: assignments2. - * Current assignments in the metastorage: stable=null, pending=assignments3, planned=null. - * Expected assignments in the metastorage after updating: stable=null, pending=assignments3, planned=assignments1. - */ - @Test - void test3() { - test( - nodes1, assignments2, - null, assignments3, null, - null, assignments3, assignments1, assignmentsTimestamp - ); - } - - /** - * Nodes for new assignments calculating: nodes1. - * The table configuration assignments: assignments1. - * Current assignments in the metastorage: stable=null, pending=assignments3, planned=null. - * Expected assignments in the metastorage after updating: stable=null, pending=assignments3, planned=assignments1. - */ - @Test - void test4() { - test( - nodes1, assignments1, - null, assignments3, null, - null, assignments3, assignments1, assignmentsTimestamp - ); - } - - /** - * Nodes for new assignments calculating: nodes1. - * The table configuration assignments: assignments2. - * Current assignments in the metastorage: stable=assignments3, pending=null, planned=null. - * Expected assignments in the metastorage after updating: stable=assignments3, pending=assignments1, planned=null. - */ - @Test - void test5() { - test( - nodes1, assignments2, - assignments3, null, null, - assignments3, assignments1, null, assignmentsTimestamp - ); - } - - /** - * Nodes for new assignments calculating: nodes1. - * The table configuration assignments: assignments1. - * Current assignments in the metastorage: stable=assignments3, pending=null, planned=null. - * Expected assignments in the metastorage after updating: stable=assignments3, pending=assignments1, planned=null. - */ - @Test - void test6() { - test( - nodes1, assignments1, - assignments3, null, null, - assignments3, assignments1, null, assignmentsTimestamp - ); - } - - /** - * Nodes for new assignments calculating: nodes1. - * The table configuration assignments: assignments2. - * Current assignments in the metastorage: stable=assignments1, pending=null, planned=null. - * Expected assignments in the metastorage after updating: stable=assignments1, pending=null, planned=null. - */ - @Test - void test7() { - test( - nodes1, assignments2, - assignments1, null, null, - assignments1, null, null, assignmentsTimestamp - ); - } - - /** - * Nodes for new assignments calculating: nodes1. - * The table configuration assignments: assignments1. - * Current assignments in the metastorage: stable=assignments1, pending=null, planned=null. - * Expected assignments in the metastorage after updating: stable=assignments1, pending=null, planned=null. - */ - @Test - void test8() { - test( - nodes1, assignments1, - assignments1, null, null, - assignments1, null, null, assignmentsTimestamp - ); - } - - /** - * Nodes for new assignments calculating: nodes1. - * The table configuration assignments: assignments2. - * Current assignments in the metastorage: stable=assignments2, pending=null, planned=null. - * Expected assignments in the metastorage after updating: stable=assignments2, pending=assignments1, planned=null. - */ - @Test - void test9() { - test( - nodes1, assignments2, - assignments2, null, null, - assignments2, assignments1, null, assignmentsTimestamp - ); - } - - /** - * Nodes for new assignments calculating: nodes1. - * The table configuration assignments: assignments2. - * Current assignments in the metastorage: stable=assignments4, pending=assignments3, planned=null. - * Expected assignments in the metastorage after updating: stable=assignments4, pending=assignments3, planned=assignments1. - */ - @Test - void test10() { - test( - nodes1, assignments2, - assignments4, assignments3, null, - assignments4, assignments3, assignments1, assignmentsTimestamp - ); - } - - /** - * Nodes for new assignments calculating: nodes1. - * The table configuration assignments: assignments1. - * Current assignments in the metastorage: stable=assignments3, pending=assignments2, planned=null. - * Expected assignments in the metastorage after updating: stable=assignments3, pending=assignments2, planned=assignments1. - */ - @Test - void test11() { - test( - nodes1, assignments1, - assignments3, assignments2, null, - assignments3, assignments2, assignments1, assignmentsTimestamp - ); - } - - /** - * Nodes for new assignments calculating: nodes1. - * The table configuration assignments: assignments2. - * Current assignments in the metastorage: stable=assignments1, pending=assignments3, planned=null. - * Expected assignments in the metastorage after updating: stable=assignments1, pending=assignments3, planned=assignments1. - */ - @Test - void test12() { - test( - nodes1, assignments2, - assignments1, assignments3, null, - assignments1, assignments3, assignments1, assignmentsTimestamp - ); - } - - /** - * Nodes for new assignments calculating: nodes1. - * The table configuration assignments: assignments2. - * Current assignments in the metastorage: stable=assignments2, pending=assignments3, planned=null. - * Expected assignments in the metastorage after updating: stable=assignments2, pending=assignments3, planned=assignments1. - */ - @Test - void test13() { - test( - nodes1, assignments2, - assignments2, assignments3, null, - assignments2, assignments3, assignments1, assignmentsTimestamp - ); - } - - /** - * Nodes for new assignments calculating: nodes1. - * The table configuration assignments: assignments1. - * Current assignments in the metastorage: stable=assignments1, pending=assignments2, planned=null. - * Expected assignments in the metastorage after updating: stable=assignments1, pending=assignments2, planned=assignments1. - */ - @Test - void test14() { - test( - nodes1, assignments1, - assignments1, assignments2, null, - assignments1, assignments2, assignments1, assignmentsTimestamp - ); - } - - /** - * Nodes for new assignments calculating: nodes1. - * The table configuration assignments: assignments1. - * Current assignments in the metastorage: stable=assignments1, pending=assignments2, planned=assignments3. - * Expected assignments in the metastorage after updating: stable=assignments1, pending=assignments2, planned=assignments1. - */ - @Test - void test15() { - test( - nodes1, assignments1, - assignments1, assignments2, assignments3, - assignments1, assignments2, assignments1, assignmentsTimestamp - ); - } - - /** - * Nodes for new assignments calculating: nodes1. - * The table configuration assignments: assignments4. - * Current assignments in the metastorage: stable=assignments1, pending=assignments2, planned=assignments1. - * Expected assignments in the metastorage after updating: stable=assignments1, pending=assignments2, planned=assignments1. - */ - @Test - void test16() { - test( - nodes1, assignments4, - assignments1, assignments2, assignments1, - assignments1, assignments2, assignments1, assignmentsTimestamp - ); - } - - /** - * Nodes for new assignments calculating: nodes2. - * The table configuration assignments: assignments2. - * Current assignments in the metastorage: stable=assignments1, pending=assignments2, planned=assignments1. - * Expected assignments in the metastorage after updating: stable=assignments1, pending=assignments2, planned=null. - */ - @Test - void test17() { - test( - nodes2, assignments2, - assignments1, assignments2, assignments1, - assignments1, assignments2, null, assignmentsTimestamp - ); - } - - /** - * Nodes for new assignments calculating: nodes2. - * The table configuration assignments: assignments4. - * Current assignments in the metastorage: stable=assignments1, pending=assignments2, planned=assignments1. - * Expected assignments in the metastorage after updating: stable=assignments1, pending=assignments2, planned=null. - */ - @Test - void test18() { - test( - nodes2, assignments4, - assignments1, assignments2, assignments1, - assignments1, assignments2, null, assignmentsTimestamp + private static Stream<Arguments> assignmentsProvider() { Review Comment: To fix bad practice in tests. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@ignite.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org