Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Always use block/blockLast/verify with timeout #3238

Merged
merged 3 commits into from May 13, 2024
Merged

Conversation

violetagg
Copy link
Member

No description provided.

@violetagg violetagg added the type/test A general test label May 10, 2024
@violetagg violetagg added this to the 1.0.45 milestone May 10, 2024
@violetagg violetagg requested a review from a team May 10, 2024 09:01
@violetagg
Copy link
Member Author

Failed tests on CI are not related

@pderop
Copy link
Member

pderop commented May 13, 2024

There are still some block/blockLast/verify methods which have not been updated with a Duration, is it intentional ?
for examples, see in

@violetagg
Copy link
Member Author

There are still some block/blockLast/verify methods which have not been updated with a Duration, is it intentional ? for examples, see in

Fixed.

Fixed.

Fixed.

List<String> expected =
Flux.range(1, 20)
.map(v -> "test")
.collectList()
.block();

Flux is already defined with concrete values. I don't think there will be an endless waiting.

List<String> expected =
Flux.range(1, c)
.map(v -> "test")
.collectList()
.block();

Flux is already defined with concrete values. I don't think there will be an endless waiting.

List<String> expected =
Flux.range(1, c)
.map(v -> "test")
.collectList()
.block();

Flux is already defined with concrete values. I don't think there will be an endless waiting.

List<String> expected =
Flux.range(1, 20)
.map(v -> "test")
.collectList()
.block();

Flux is already defined with concrete values. I don't think there will be an endless waiting.

Flux<String> flux = Flux.range(0, 100)
.map(n -> String.format("%010d", n));
List<String> test =
flux.collectList()
.block();

flux is already defined with concrete values. I don't think there will be an endless waiting.

Flux<String> flux = Flux.range(0, 100)
.map(n -> String.format("%010d", n));
AtomicReference<List<String>> receiver = new AtomicReference<>(new ArrayList<>());
AtomicReference<WebSocketCloseStatus> statusServer = new AtomicReference<>();
AtomicReference<WebSocketCloseStatus> statusClient = new AtomicReference<>();
CountDownLatch latch = new CountDownLatch(3);
List<String> test =
flux.collectList()
.block();

flux is already defined with concrete values. I don't think there will be an endless waiting.

Mono.delay(Duration.ofMillis(500))
.block();

A delay is known and then this will be completed. I don't think there will be an endless waiting.

void testPath() {
TestHttpInfos infos = new TestHttpInfos();
Flux<String> expectations = Flux.just("", "", "", "/", "a", "a", "", "a", "", "a", "a", "a b", "a");
doTestPath(infos, expectations,
Flux.just("http://localhost:8080",
"http://localhost:8080/",
"http://localhost:8080//",
"http://localhost:8080///",
"http://localhost:8080/a",
"http://localhost:8080/a/",
"http://localhost:8080/?b",
"http://localhost:8080/a?b",
"http://localhost:8080/#b",
"http://localhost:8080/a#b",
"http://localhost:8080/a?b#c",
"http://localhost:8080/a%20b",
"http://localhost:8080/a?b={}"));
doTestPath(infos, expectations,
Flux.just("localhost:8080",
"localhost:8080/",
"localhost:8080//",
"localhost:8080///",
"localhost:8080/a",
"localhost:8080/a/",
"localhost:8080/?b",
"localhost:8080/a?b",
"localhost:8080/#b",
"localhost:8080/a#b",
"localhost:8080/a?b#c",
"localhost:8080/a%20b",
"localhost:8080/a?b={}"));
doTestPath(infos, expectations,
Flux.just("", "/", "//", "///", "/a", "/a/", "/?b", "/a?b", "/#b", "/a#b", "/a?b#c", "/a%20b", "/a?b={}"));
}
private void doTestPath(TestHttpInfos infos, Flux<String> expectations, Flux<String> uris) {
uris.zipWith(expectations)
.doOnNext(tuple -> {
infos.uri = tuple.getT1();
assertThat(tuple.getT2()).isEqualTo(infos.path());
})
.blockLast();
}

Flux<String> expectations and Flux<String> uris are already defined with concrete values. I don't think there will be an endless waiting.

@violetagg
Copy link
Member Author

Failed tests on CI are not related

@violetagg
Copy link
Member Author

@pderop Thanks!

@violetagg violetagg merged commit d48cc15 into 1.0.x May 13, 2024
7 of 9 checks passed
@violetagg violetagg deleted the block-with-timeout branch May 13, 2024 11:09
violetagg added a commit that referenced this pull request May 13, 2024
violetagg added a commit that referenced this pull request May 13, 2024
violetagg added a commit that referenced this pull request May 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/test A general test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants