Github user pnowojski commented on a diff in the pull request:

    https://github.com/apache/flink/pull/5239#discussion_r160136572
  
    --- Diff: 
flink-contrib/flink-storm/src/test/java/org/apache/flink/storm/wrappers/BoltWrapperTest.java
 ---
    @@ -375,11 +376,13 @@ public void declareOutputFields(OutputFieldsDeclarer 
declarer) {
                when(env.getMetricGroup()).thenReturn(new 
UnregisteredTaskMetricsGroup());
                when(env.getTaskManagerInfo()).thenReturn(new 
TestingTaskManagerRuntimeInfo());
     
    +           final CloseableRegistry closeableRegistry = new 
CloseableRegistry();
                StreamTask<?, ?> mockTask = mock(StreamTask.class);
                when(mockTask.getCheckpointLock()).thenReturn(new Object());
                when(mockTask.getConfiguration()).thenReturn(new 
StreamConfig(new Configuration()));
                when(mockTask.getEnvironment()).thenReturn(env);
                when(mockTask.getExecutionConfig()).thenReturn(execConfig);
    +           when(mockTask.getCancelables()).thenReturn(closeableRegistry);
    --- End diff --
    
    I don't like the idea of postponing such things. I really would like it to 
be done in this pr (as a separate commit, ideally at the bottom to avoid 
modifying same lines of code twice, but as a last resort it could also be the 
last commit). Otherwise we will forget about it and while this only one added 
line it increases our technological debt and makes our code base a tiny bit 
worse then it used to be before - both of those things are quite dangerous. 


---

Reply via email to