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

    https://github.com/apache/spark/pull/21390#discussion_r189816085
  
    --- Diff: 
common/network-shuffle/src/test/java/org/apache/spark/network/shuffle/NonShuffleFilesCleanupSuite.java
 ---
    @@ -0,0 +1,222 @@
    +/*
    + * 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.spark.network.shuffle;
    +
    +import java.io.File;
    +import java.io.FilenameFilter;
    +import java.io.IOException;
    +import java.nio.charset.StandardCharsets;
    +import java.util.Random;
    +import java.util.concurrent.Executor;
    +import java.util.concurrent.atomic.AtomicBoolean;
    +
    +import com.google.common.util.concurrent.MoreExecutors;
    +import org.junit.Test;
    +import static org.junit.Assert.assertFalse;
    +import static org.junit.Assert.assertTrue;
    +
    +import org.apache.spark.network.util.MapConfigProvider;
    +import org.apache.spark.network.util.TransportConf;
    +
    +public class NonShuffleFilesCleanupSuite {
    --- End diff --
    
    Do we need a test to check that we preserve the old behavior in case the 
new configuration is set to `false`? An end-to-end test will likely be prone to 
flakiness, so instead maybe we could somehow test that `shuffleService. 
executorRemoved()` is _not_ called if the configuration is `false`. One way to 
do that would be to move the construction of `new ExternalShuffleService` from 
the default constructor of `Worker` into its public constructor and then inject 
it in the `new Worker` call. This, in turn, would let you inject either a mock 
or spy in order to verify call counts. Do you know if we have this style of 
test for other `Worker` functionality? Is this a ton of work or is it 
relatively simple to do?


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to