File tree Expand file tree Collapse file tree 2 files changed +7
-9
lines changed
main/java/org/springframework/web/server/session
test/java/org/springframework/web/server/session Expand file tree Collapse file tree 2 files changed +7
-9
lines changed Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright 2002-2019 the original author or authors.
2
+ * Copyright 2002-2021 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
@@ -118,7 +118,8 @@ public Mono<WebSession> createWebSession() {
118
118
this .expiredSessionChecker .checkIfNecessary (now );
119
119
120
120
return Mono .<WebSession >fromSupplier (() -> new InMemoryWebSession (now ))
121
- .subscribeOn (Schedulers .boundedElastic ());
121
+ .subscribeOn (Schedulers .boundedElastic ())
122
+ .publishOn (Schedulers .parallel ());
122
123
}
123
124
124
125
@ Override
Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright 2002-2019 the original author or authors.
2
+ * Copyright 2002-2021 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
22
22
import java .util .Map ;
23
23
import java .util .stream .IntStream ;
24
24
25
- import org .junit .jupiter .api .Disabled ;
26
25
import org .junit .jupiter .api .Test ;
27
- import reactor .core .publisher .Mono ;
28
26
import reactor .core .scheduler .Schedulers ;
29
27
30
28
import org .springframework .beans .DirectFieldAccessor ;
@@ -59,11 +57,10 @@ public void startsSessionImplicitly() {
59
57
assertThat (session .isStarted ()).isTrue ();
60
58
}
61
59
62
- @ Disabled // TODO: remove if/when Blockhound is enabled
63
- @ Test // gh-24027
60
+ @ Test // gh-24027, gh-26958
64
61
public void createSessionDoesNotBlock () {
65
- Mono . defer (() -> this .store .createWebSession () )
66
- .subscribeOn ( Schedulers .parallel ())
62
+ this .store .createWebSession ()
63
+ .doOnNext ( session -> assertThat ( Schedulers .isInNonBlockingThread ()). isTrue ())
67
64
.block ();
68
65
}
69
66
You can’t perform that action at this time.
0 commit comments