File tree Expand file tree Collapse file tree 1 file changed +12
-4
lines changed
rsocket-core/src/test/java/io/rsocket/loadbalance Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -132,10 +132,14 @@ public void shouldDeliverAllTheRequestsWithWeightedStrategy() throws Interrupted
132
132
source ,
133
133
WeightedLoadbalanceStrategy .builder ()
134
134
.weightedStatsResolver (
135
- rsocket ->
136
- ((PooledRSocket ) rsocket ).target () == target1
137
- ? weightedRSocket1
138
- : weightedRSocket2 )
135
+ rsocket -> {
136
+ if (rsocket instanceof TestRSocket ) {
137
+ return (WeightedRSocket ) ((TestRSocket ) rsocket ).source ();
138
+ }
139
+ return ((PooledRSocket ) rsocket ).target () == target1
140
+ ? weightedRSocket1
141
+ : weightedRSocket2 ;
142
+ })
139
143
.build ());
140
144
141
145
RaceTestUtils .race (
@@ -315,6 +319,10 @@ public Mono<Void> onClose() {
315
319
public void dispose () {
316
320
sink .tryEmitEmpty ();
317
321
}
322
+
323
+ public RSocket source () {
324
+ return source ;
325
+ }
318
326
}
319
327
320
328
private static class WeightedRSocket extends BaseWeightedStats implements RSocket {
You can’t perform that action at this time.
0 commit comments