Skip to content

Commit 85d3d01

Browse files
committed
fixed TestBasicExampleQuery
1 parent eb32a73 commit 85d3d01

File tree

1 file changed

+9
-14
lines changed

1 file changed

+9
-14
lines changed

tests/integration/basic_example_query_test.go

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
//go:build integration
2-
// +build integration
1+
//go:build integration && go1.23
2+
// +build integration,go1.23
33

44
package integration
55

@@ -24,6 +24,7 @@ import (
2424
"github.com/ydb-platform/ydb-go-sdk/v3"
2525
"github.com/ydb-platform/ydb-go-sdk/v3/balancers"
2626
"github.com/ydb-platform/ydb-go-sdk/v3/config"
27+
"github.com/ydb-platform/ydb-go-sdk/v3/internal/version"
2728
"github.com/ydb-platform/ydb-go-sdk/v3/internal/xtest"
2829
"github.com/ydb-platform/ydb-go-sdk/v3/log"
2930
"github.com/ydb-platform/ydb-go-sdk/v3/meta"
@@ -33,6 +34,10 @@ import (
3334
)
3435

3536
func TestBasicExampleQuery(sourceTest *testing.T) { //nolint:gocyclo
37+
if os.Getenv("YDB_VERSION") != "nightly" && version.Lt(os.Getenv("YDB_VERSION"), "24.3") {
38+
sourceTest.Skip("query service has been production ready since 24.3")
39+
}
40+
3641
t := xtest.MakeSyncedTest(sourceTest)
3742
folder := t.Name()
3843

@@ -411,22 +416,12 @@ func TestBasicExampleQuery(sourceTest *testing.T) { //nolint:gocyclo
411416
_ = res.Close(ctx)
412417
}()
413418
t.Logf("> scan_query_select:\n")
414-
for {
415-
rs, err := res.NextResultSet(ctx)
419+
for rs, err := range res.ResultSets(ctx) {
416420
if err != nil {
417-
if errors.Is(err, io.EOF) {
418-
break
419-
}
420-
421421
return err
422422
}
423-
for {
424-
row, err := rs.NextRow(ctx)
423+
for row, err := range rs.Rows(ctx) {
425424
if err != nil {
426-
if errors.Is(err, io.EOF) {
427-
break
428-
}
429-
430425
return err
431426
}
432427
var v struct {

0 commit comments

Comments
 (0)