Skip to content

Commit

Permalink
[test] Relax Flux#switchMap test2596 to avoid timeouts
Browse files Browse the repository at this point in the history
Signed-off-by: Dariusz Jędrzejczyk <dariusz.jedrzejczyk@broadcom.com>
  • Loading branch information
chemicL committed Mar 3, 2025
1 parent e5e5d2d commit 8f3c1e8
Showing 1 changed file with 20 additions and 14 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2016-2022 VMware Inc. or its affiliates, All Rights Reserved.
* Copyright (c) 2016-2025 VMware Inc. or its affiliates, All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -78,19 +78,25 @@ public void accept(Integer next) {
.onErrorResume(e -> e instanceof RejectedExecutionException ? Mono.empty() : Mono.error(e));
});

for (int i = 0; i < 100000; i++) {
StepVerifier.create(integerFlux)
.expectNextMatches(new Predicate<Integer>() {
int last = -1;
@Override
public boolean test(Integer next) {
final boolean result = last < next;
last = next;
return result;
}
})
.thenConsumeWhile(a -> true)
.verifyComplete();
try {
for (int i = 0; i < 10_000; i++) {
StepVerifier.create(integerFlux)
.expectNextMatches(new Predicate<Integer>() {
int last = -1;

@Override
public boolean test(Integer next) {
final boolean result = last < next;
last = next;
return result;
}
})
.thenConsumeWhile(a -> true)
.verifyComplete();
}
} finally {
scheduler.dispose();
scheduler2.dispose();
}
}

Expand Down

0 comments on commit 8f3c1e8

Please sign in to comment.