Skip to content

Commit 8231cea

Browse files
authored
Merge pull request #340 from ydb-platform/repeater
fix bug with nil repeater + minor fixes
2 parents b0a755c + a4d3e5d commit 8231cea

File tree

3 files changed

+3
-5
lines changed

3 files changed

+3
-5
lines changed

connection_e2e_test.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ import (
2525
"google.golang.org/protobuf/types/known/durationpb"
2626

2727
"github.com/ydb-platform/ydb-go-sdk/v3"
28-
"github.com/ydb-platform/ydb-go-sdk/v3/balancers"
2928
"github.com/ydb-platform/ydb-go-sdk/v3/config"
3029
"github.com/ydb-platform/ydb-go-sdk/v3/internal/meta"
3130
"github.com/ydb-platform/ydb-go-sdk/v3/log"
@@ -72,7 +71,6 @@ func TestConnection(t *testing.T) {
7271
config.WithOperationTimeout(time.Second*2),
7372
config.WithOperationCancelAfter(time.Second*2),
7473
),
75-
ydb.WithBalancer(balancers.SingleConn()),
7674
ydb.WithConnectionTTL(time.Millisecond*10000),
7775
ydb.WithMinTLSVersion(tls.VersionTLS10),
7876
ydb.WithLogger(
@@ -117,7 +115,7 @@ func TestConnection(t *testing.T) {
117115
defer func() {
118116
// cleanup connection
119117
if e := db.Close(ctx); e != nil {
120-
t.Fatalf("balancer close failed: %+v", e)
118+
t.Fatalf("close failed: %+v", e)
121119
}
122120
}()
123121
t.Run("discovery.WhoAmI", func(t *testing.T) {

internal/balancer/balancer.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ func (b *balancer) getConn(ctx context.Context) (c conn.Conn, err error) {
287287
)
288288

289289
defer func() {
290-
if failedCount*2 > state.PreferredCount() {
290+
if failedCount*2 > state.PreferredCount() && b.discoveryRepeater != nil {
291291
b.discoveryRepeater.Force()
292292
}
293293
}()

topic/client_e2e_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ func connect(t testing.TB) ydb.Connection {
4646
}
4747
db, err := ydb.Open(context.Background(), connectionString,
4848
ydb.WithDialTimeout(time.Second),
49-
ydb.WithAccessTokenCredentials(os.Getenv("YDB_TOKEN")),
49+
ydb.WithAccessTokenCredentials(os.Getenv("YDB_ACCESS_TOKEN_CREDENTIALS")),
5050
)
5151
require.NoError(t, err)
5252
return db

0 commit comments

Comments
 (0)