ErnestasVaiciukeviciusAdform commented on code in PR #9175:
URL: https://github.com/apache/storm/pull/9175#discussion_r4312762688


##########
storm-client/test/jvm/org/apache/storm/daemon/worker/WorkerOutboundTasksTest.java:
##########
@@ -0,0 +1,124 @@
+/*
+ * 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.storm.daemon.worker;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import org.apache.storm.Config;
+import org.apache.storm.generated.StormTopology;
+import org.apache.storm.spout.SpoutOutputCollector;
+import org.apache.storm.task.GeneralTopologyContext;
+import org.apache.storm.task.TopologyContext;
+import org.apache.storm.topology.IRichBolt;
+import org.apache.storm.topology.IRichSpout;
+import org.apache.storm.topology.OutputFieldsDeclarer;
+import org.apache.storm.topology.TopologyBuilder;
+import org.apache.storm.topology.base.BaseRichBolt;
+import org.apache.storm.topology.base.BaseRichSpout;
+import org.apache.storm.tuple.Tuple;
+import org.junit.jupiter.api.Test;
+
+/**
+ * Unit tests for {@link WorkerState#computeOutboundTasks}, which decides the 
set of task ids a worker must be able to
+ * route messages to. The key behaviour under test: when upstream feedback is 
enabled, the upstream (source) component
+ * tasks of locally-hosted components must be included, because feedback 
tuples are routed directly to them. Otherwise
+ * they are missing from {@code cachedTaskToNodePort}, the feedback is dropped 
and {@code TransferDrainer} logs the
+ * spurious "No remote destination available for task" warning.
+ */
+public class WorkerOutboundTasksTest {
+
+    // Linear topology: spout -> bolt1 -> bolt2. Task ids are topology-global 
and unique per component.
+    private static final List<Integer> SPOUT_TASKS = Arrays.asList(1, 2);
+    private static final List<Integer> BOLT1_TASKS = Arrays.asList(3, 4);
+    private static final List<Integer> BOLT2_TASKS = Arrays.asList(5, 6);
+
+    private GeneralTopologyContext context() {

Review Comment:
   Added acker and additional test cases:
   * feedbackEnabled_systemComponentsUpstreamNotAddedAsFeedbackTasks
   * feedbackDisabled_colocatedSpoutMasksMissingUpstreamRouting



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to