Skip to content

Commit 5ea9ac4

Browse files
committed
fix session shutdown test
1 parent 157766b commit 5ea9ac4

File tree

3 files changed

+16
-15
lines changed

3 files changed

+16
-15
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
## 3.8.8
2+
* Refactoring session shutdown test
3+
14
## 3.8.7
25
* Ignored session shutdown test if no defined `YDB_SHUTDOWN_URLS` environment variable
36

internal/meta/version.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
package meta
22

33
const (
4-
Version = "ydb-go-sdk/3.8.7"
4+
Version = "ydb-go-sdk/3.8.8"
55
)

test/table_test.go

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -606,22 +606,20 @@ func TestTable(t *testing.T) {
606606
})
607607
})
608608
t.Run("SessionsShutdown", func(t *testing.T) {
609-
urls := strings.Split(os.Getenv("YDB_SHUTDOWN_URLS"), ",")
610-
for _, url := range urls {
611-
url = strings.TrimSpace(url)
612-
if len(url) > 0 {
613-
// nolint:gosec
614-
_, err := http.Get(url)
615-
if err != nil {
616-
t.Fatalf("failed to send request: %v", err)
617-
}
618-
}
609+
urls := os.Getenv("YDB_SHUTDOWN_URLS")
610+
if len(urls) == 0 {
611+
t.Skip("skip test of session gracefull shutdown")
619612
}
620-
if len(urls) > 0 {
621-
shutdownedMtx.Lock()
622-
defer shutdownedMtx.Unlock()
623-
shutdowned = true
613+
for _, url := range strings.Split(urls, ",") {
614+
// nolint:gosec
615+
_, err := http.Get(url)
616+
if err != nil {
617+
t.Fatalf("failed to send request: %v", err)
618+
}
624619
}
620+
shutdownedMtx.Lock()
621+
defer shutdownedMtx.Unlock()
622+
shutdowned = true
625623
})
626624
t.Run("SelectConcurrently", func(t *testing.T) {
627625
wg := sync.WaitGroup{}

0 commit comments

Comments
 (0)