mirror of https://github.com/halo-dev/halo
[release-2.16] Fix concurrent issue during bundle file concurrent generation testing (#6045)
This is an automated cherry-pick of #6043 /assign JohnNiang ```release-note None ```pull/6050/head
parent
3836b22090
commit
0bd8611144
|
@ -432,17 +432,20 @@ class PluginServiceImplTest {
|
|||
|
||||
var probes = new ArrayList<PublisherProbe<DataBuffer>>();
|
||||
List<? extends Future<?>> futures = IntStream.range(0, 10)
|
||||
.mapToObj(i -> executorService.submit(() -> {
|
||||
.mapToObj(i -> {
|
||||
var fakeContent = Mono.<DataBuffer>just(sharedInstance.wrap(
|
||||
("fake-content-" + i).getBytes(UTF_8)
|
||||
));
|
||||
var probe = PublisherProbe.of(fakeContent);
|
||||
probes.add(probe);
|
||||
return executorService.submit(
|
||||
() -> {
|
||||
cache.computeIfAbsent("fake-version", probe.mono())
|
||||
.as(StepVerifier::create)
|
||||
.expectNextCount(1)
|
||||
.verifyComplete();
|
||||
}))
|
||||
});
|
||||
})
|
||||
.toList();
|
||||
executorService.shutdown();
|
||||
futures.forEach(future -> {
|
||||
|
|
Loading…
Reference in New Issue