From fc82a7876c153f02523d859091f069865bb6c039 Mon Sep 17 00:00:00 2001 From: VIKAS MATHUR <97077039+vmathur12@users.noreply.github.com> Date: Sat, 31 Aug 2024 17:36:37 +0530 Subject: [PATCH] Update Pooling testcases (#252) Update actions version in go.yml to use Nodejs20 --------- Co-authored-by: Vikas Mathur Co-authored-by: Bimal Kumar Jha --- .github/workflows/go.yml | 5 +++-- testdata/main.go | 16 ++++++++++++---- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 8bd2d08..405e8ea 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -14,10 +14,10 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up Go - uses: actions/setup-go@v4 + uses: actions/setup-go@v5 with: go-version: '1.22.5' @@ -38,6 +38,7 @@ jobs: - name: Test env: DB2_CONNSTR: ${{ secrets.DB2_CONNSTR }} + if: ${{ env.DB2_CONNSTR != '' && env.DB2_CONNSTR != null }} run: | pwd cd testdata diff --git a/testdata/main.go b/testdata/main.go index 29b6d62..b1031d7 100755 --- a/testdata/main.go +++ b/testdata/main.go @@ -546,8 +546,12 @@ func ConnectionPool() int { var flag int flag = 0 - db := Createconnection() - defer db.Close() + errCreatetable := Createtable(); + if errCreatetable != nil { + fmt.Println("Createtable error: ", errCreatetable) + return 0 + } + Insert() pool := a.Pconnect("PoolSize=5") @@ -589,8 +593,12 @@ func ConnectionPoolWithTimeout() int { var flag int flag = 0 - db := Createconnection() - defer db.Close() + errCreatetable := Createtable(); + if errCreatetable != nil { + fmt.Println("Createtable error: ", errCreatetable) + return 0 + } + Insert() pool := a.Pconnect("PoolSize=3")