Skip to content

Commit f4aa3d5

Browse files
committed
temporary commit
1 parent a6a4988 commit f4aa3d5

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

connection.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1454,15 +1454,12 @@ func isFeatureInSlice(expected iproto.Feature, actualSlice []iproto.Feature) boo
14541454
//
14551455
// Since 1.10.0
14561456
func (conn *Connection) NewWatcher(key string, callback WatchCallback) (Watcher, error) {
1457-
if conn.c == nil {
1458-
return nil, ClientError{ErrConnectionNotReady, "client connection is not ready"}
1459-
}
14601457
// We need to check the feature because the IPROTO_WATCH request is
14611458
// asynchronous. We do not expect any response from a Tarantool instance
14621459
// That's why we can't just check the Tarantool response for an unsupported
14631460
// request error.
14641461
if !isFeatureInSlice(iproto.IPROTO_FEATURE_WATCHERS,
1465-
conn.c.ProtocolInfo().Features) {
1462+
conn.serverProtocolInfo.Features) {
14661463
err := fmt.Errorf("the feature %s must be supported by connection "+
14671464
"to create a watcher", iproto.IPROTO_FEATURE_WATCHERS)
14681465
return nil, err

tarantool_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3594,7 +3594,7 @@ func TestNewWatcherDuringReconnectOrAfterClose(t *testing.T) {
35943594
conn.Close()
35953595
_, err = conn.NewWatcher("two", func(event WatchEvent) {})
35963596
assert.NotNil(t, err)
3597-
assert.ErrorContains(t, err, "client connection is not ready")
3597+
assert.ErrorContains(t, err, "using closed connection")
35983598
}
35993599

36003600
func TestConnection_NewWatcher_noWatchersFeature(t *testing.T) {
@@ -4195,13 +4195,13 @@ func runTestMain(m *testing.M) int {
41954195
startOpts.MemtxUseMvccEngine = !isStreamUnsupported
41964196

41974197
inst, err := test_helpers.StartTarantool(startOpts)
4198-
defer test_helpers.StopTarantoolWithCleanup(inst)
4199-
42004198
if err != nil {
42014199
log.Printf("Failed to prepare test tarantool: %s", err)
42024200
return 1
42034201
}
42044202

4203+
defer test_helpers.StopTarantoolWithCleanup(inst)
4204+
42054205
return m.Run()
42064206
}
42074207

0 commit comments

Comments
 (0)