Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions af/stmt2_3360_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ func TestStmt2_3360(t *testing.T) {
if !assert.NoError(t, err) {
return
}
defer func() {
err = conn.Close()
assert.NoError(t, err)
}()
stmt2 := conn.Stmt2(0x12345678, false)
if stmt2 == nil {
t.Errorf("Expected stmt to be not nil")
Expand Down
20 changes: 20 additions & 0 deletions af/stmt2_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ func TestStmt2CallBackCallerPool(t *testing.T) {
func TestNewStmt2(t *testing.T) {
conn, err := Open("", "root", "taosdata", "", 0)
assert.NoError(t, err)
defer func() {
err = conn.Close()
assert.NoError(t, err)
}()
stmt := conn.Stmt2(0x12345678, false)
if stmt == nil {
t.Errorf("Expected stmt to be not nil")
Expand All @@ -82,6 +86,10 @@ func TestStmt2(t *testing.T) {
if !assert.NoError(t, err) {
return
}
defer func() {
err = conn.Close()
assert.NoError(t, err)
}()
stmt2 := conn.Stmt2(0x12345678, true)
if stmt2 == nil {
t.Errorf("Expected stmt to be not nil")
Expand Down Expand Up @@ -335,6 +343,10 @@ func TestStmt2_Prepare(t *testing.T) {
if !assert.NoError(t, err) {
return
}
defer func() {
err = conn.Close()
assert.NoError(t, err)
}()
stmt2 := conn.Stmt2(0x123456789, false)
if stmt2 == nil {
t.Errorf("Expected stmt to be not nil")
Expand Down Expand Up @@ -389,6 +401,10 @@ func TestStmt2QueryResultWithDecimal(t *testing.T) {
if !assert.NoError(t, err) {
return
}
defer func() {
err = conn.Close()
assert.NoError(t, err)
}()
stmt2 := conn.Stmt2(0x12345678, false)
if stmt2 == nil {
t.Errorf("Expected stmt to be not nil")
Expand Down Expand Up @@ -457,6 +473,10 @@ func TestStmt2Timezone(t *testing.T) {
if !assert.NoError(t, err) {
return
}
defer func() {
err = conn.Close()
assert.NoError(t, err)
}()
tz := "Europe/Paris"
timezone, err := time.LoadLocation(tz)
require.NoError(t, err)
Expand Down
4 changes: 4 additions & 0 deletions af/stmt_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ func TestStmtQueryResultWithDecimal(t *testing.T) {
if !assert.NoError(t, err) {
return
}
defer func() {
err = conn.Close()
assert.NoError(t, err)
}()
stmt := conn.Stmt()
if stmt == nil {
t.Errorf("Expected stmt to be not nil")
Expand Down
2 changes: 1 addition & 1 deletion version/version.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package version

const Tag = "v3.7.8"
const Commit = "5328b71"
const Commit = "96e0e3b"
25 changes: 14 additions & 11 deletions wrapper/notify_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (

"github.com/stretchr/testify/assert"
"github.com/taosdata/driver-go/v3/common"
"github.com/taosdata/driver-go/v3/common/testenv"
"github.com/taosdata/driver-go/v3/wrapper/cgo"
)

Expand Down Expand Up @@ -71,17 +72,19 @@ func TestNotify(t *testing.T) {
t.Error("wait for notify callback timeout")
}

err = exec(conn, "ALTER USER t_notify ADD HOST '192.168.1.98/0','192.168.1.98/32'")
assert.NoError(t, err)
timeoutWhiteList, cancelWhitelist := context.WithTimeout(context.Background(), time.Second*5)
defer cancelWhitelist()
now = time.Now()
select {
case version := <-notifyWhitelist:
t.Log(time.Since(now))
t.Log("whitelist changed", version)
case <-timeoutWhiteList.Done():
t.Error("wait for notifyWhitelist callback timeout")
if testenv.IsEnterpriseTest() {
err = exec(conn, "ALTER USER t_notify ADD HOST '192.168.1.98/0','192.168.1.98/32'")
assert.NoError(t, err)
timeoutWhiteList, cancelWhitelist := context.WithTimeout(context.Background(), time.Second*5)
defer cancelWhitelist()
now = time.Now()
select {
case version := <-notifyWhitelist:
t.Log(time.Since(now))
t.Log("whitelist changed", version)
case <-timeoutWhiteList.Done():
t.Error("wait for notifyWhitelist callback timeout")
}
}

err = exec(conn, "drop USER t_notify")
Expand Down