Skip to content

Commit fdb6a37

Browse files
authored
fix ut. (#72)
1 parent a41ced5 commit fdb6a37

File tree

1 file changed

+0
-42
lines changed

1 file changed

+0
-42
lines changed

rsocket_test.go

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ import (
1717
"github.com/rsocket/rsocket-go/core/transport"
1818
"github.com/rsocket/rsocket-go/extension"
1919
"github.com/rsocket/rsocket-go/lease"
20-
"github.com/rsocket/rsocket-go/logger"
2120
"github.com/rsocket/rsocket-go/payload"
2221
"github.com/rsocket/rsocket-go/rx"
2322
"github.com/rsocket/rsocket-go/rx/flux"
@@ -55,13 +54,6 @@ func TestResume(t *testing.T) {
5554
}()
5655

5756
go func(ctx context.Context) {
58-
defer func() {
59-
select {
60-
case <-started:
61-
default:
62-
close(started)
63-
}
64-
}()
6557
_ = Receive().
6658
OnStart(func() {
6759
close(started)
@@ -168,13 +160,6 @@ func TestConnectBroken(t *testing.T) {
168160
port := 8787
169161

170162
go func(ctx context.Context) {
171-
defer func() {
172-
select {
173-
case <-started:
174-
default:
175-
close(started)
176-
}
177-
}()
178163
_ = Receive().
179164
OnStart(func() {
180165
close(started)
@@ -223,15 +208,6 @@ func TestBiDirection(t *testing.T) {
223208
defer cancel()
224209

225210
go func(ctx context.Context) {
226-
227-
defer func() {
228-
select {
229-
case <-started:
230-
default:
231-
close(started)
232-
}
233-
}()
234-
235211
l, _ := lease.NewSimpleFactory(3*time.Second, 1*time.Second, 1*time.Second, 10)
236212
_ = Receive().
237213
Lease(l).
@@ -339,15 +315,6 @@ func testAll(t *testing.T, proto string, clientTp transport.ClientTransporter, s
339315
serving := make(chan struct{})
340316

341317
go func(ctx context.Context) {
342-
343-
defer func() {
344-
select {
345-
case <-serving:
346-
default:
347-
close(serving)
348-
}
349-
}()
350-
351318
err := Receive().
352319
Fragment(128).
353320
OnStart(func() {
@@ -642,18 +609,9 @@ func (d delayedRSocket) RequestChannel(messages rx.Publisher) flux.Flux {
642609
}
643610

644611
func TestContextTimeout(t *testing.T) {
645-
logger.SetLevel(logger.LevelDebug)
646612
var responder delayedRSocket
647613
started := make(chan struct{})
648614
go func() {
649-
defer func() {
650-
select {
651-
case <-started:
652-
default:
653-
close(started)
654-
}
655-
}()
656-
657615
_ = Receive().
658616
OnStart(func() {
659617
close(started)

0 commit comments

Comments
 (0)