Fix RotatingServersTests concurrency
https://build.spring.io/browse/INT-FATS5IC-685/ Even if we stop `SourcePollingChannelAdapter`, the task on the fly is still going to be executed. This way we may have extra calls to our logic. * Use `CopyOnWriteArrayList` for the `sessionSources` to avoid `ConcurrentModificationException` during this collection read in the tests **Cherry-pick to 5.0.x**
This commit is contained in:
@@ -22,6 +22,7 @@ import java.io.ByteArrayInputStream;
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.CopyOnWriteArrayList;
|
||||
import java.util.concurrent.CountDownLatch;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.stream.Collectors;
|
||||
@@ -166,7 +167,7 @@ public class RotatingServersTests extends FtpTestSupport {
|
||||
|
||||
private final CountDownLatch latch = new CountDownLatch(17);
|
||||
|
||||
List<Integer> sessionSources = new ArrayList<>();
|
||||
final List<Integer> sessionSources = new CopyOnWriteArrayList<>();
|
||||
|
||||
@Bean
|
||||
public SessionFactory<FTPFile> factory1() {
|
||||
|
||||
Reference in New Issue
Block a user