mayankshriv commented on a change in pull request #6399: URL: https://github.com/apache/incubator-pinot/pull/6399#discussion_r552057372
########## File path: pinot-controller/src/test/java/org/apache/pinot/controller/helix/core/assignment/instance/InstanceTagPoolSelectorTest.java ########## @@ -0,0 +1,167 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.apache.pinot.controller.helix.core.assignment.instance; + +import static org.testng.Assert.assertEquals; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.apache.helix.model.InstanceConfig; +import org.apache.pinot.common.utils.config.InstanceUtils; +import org.apache.pinot.spi.config.table.assignment.InstanceTagPoolConfig; +import org.testng.annotations.Test; + + +public class InstanceTagPoolSelectorTest { + + private InstanceTagPoolConfig _tagPoolConfig; + private String _tableNameWithType = "tableNameWithType";; + private static final String _tag = "testTag"; + + @Test + public void testSelectInstances_PoolBasedTagConfig() { Review comment: Add description on exactly what is being tested. Also, use camelCase names, eg, `testPoolTagBasedInstanceSelection`. ########## File path: pinot-controller/src/test/java/org/apache/pinot/controller/helix/core/assignment/instance/InstanceTagPoolSelectorTest.java ########## @@ -0,0 +1,167 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.apache.pinot.controller.helix.core.assignment.instance; + +import static org.testng.Assert.assertEquals; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.apache.helix.model.InstanceConfig; +import org.apache.pinot.common.utils.config.InstanceUtils; +import org.apache.pinot.spi.config.table.assignment.InstanceTagPoolConfig; +import org.testng.annotations.Test; + + +public class InstanceTagPoolSelectorTest { + + private InstanceTagPoolConfig _tagPoolConfig; + private String _tableNameWithType = "tableNameWithType";; + private static final String _tag = "testTag"; + + @Test + public void testSelectInstances_PoolBasedTagConfig() { + String poolNum = "1"; + String testInstanceName = "testInstanceId"; + List<Integer> poolList = Arrays.asList(1); + _tagPoolConfig = new InstanceTagPoolConfig(_tag, true, 5, poolList); Review comment: This code snippet is being used in multiple tests (with variations), perhaps consider refactoring out into a helper function. ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org For additional commands, e-mail: commits-h...@pinot.apache.org