Skip to content

Commit

Permalink
fix(gRPC): golang CI Linter failure on http2Client (#1706)
Browse files Browse the repository at this point in the history
  • Loading branch information
DMwangnima committed Feb 18, 2025
1 parent 0880142 commit 276258f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion pkg/remote/trans/nphttp2/grpc/http2_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ type closeStreamTask struct {
toCloseStreams []*Stream
}

func (task closeStreamTask) Tick() {
func (task *closeStreamTask) Tick() {
trans := task.t
trans.mu.Lock()
for _, stream := range trans.activeStreams {
Expand Down
9 changes: 4 additions & 5 deletions pkg/streamx/provider/ttstream/stream_reader_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ package ttstream
import (
"context"
"errors"
"sync/atomic"
"testing"
"time"

Expand All @@ -33,20 +32,20 @@ func TestStreamReader(t *testing.T) {

// basic IOs
sio := newStreamReader()
var done int32
doneCh := make(chan struct{})
go func() {
for i := 0; i < round; i++ {
sio.input(ctx, msg)
}
atomic.StoreInt32(&done, 1)
close(doneCh)
}()
for i := 0; i < round; i++ {
payload, err := sio.output(ctx)
test.Assert(t, err == nil, err)
test.DeepEqual(t, msg, payload)
}
test.Assert(t, atomic.LoadInt32(&done) == int32(1))

// wait for goroutine exited
<-doneCh
// exception IOs
sio.input(ctx, msg)
targetErr := errors.New("test")
Expand Down

0 comments on commit 276258f

Please sign in to comment.