Skip to content

Commit 7c47d29

Browse files
committed
test: debugging
1 parent 20dc742 commit 7c47d29

File tree

3 files changed

+13
-6
lines changed

3 files changed

+13
-6
lines changed

.github/workflows/testing.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,9 @@ jobs:
273273
cd "${SRCDIR}"
274274
make deps
275275
276+
- name: Setup tmate session
277+
uses: mxschmitt/action-tmate@v3
278+
276279
- name: Run regression tests
277280
run: |
278281
cd "${SRCDIR}"

pool/connection_pool_test.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1041,12 +1041,15 @@ func TestCloseGraceful(t *testing.T) {
10411041
}
10421042

10431043
type testHandler struct {
1044-
discovered, deactivated uint32
1045-
errs []error
1044+
t *testing.T
1045+
discovered uint32
1046+
deactivated uint32
1047+
errs []error
10461048
}
10471049

10481050
func (h *testHandler) addErr(err error) {
10491051
h.errs = append(h.errs, err)
1052+
h.t.Logf("handler error: %s", err)
10501053
}
10511054

10521055
func (h *testHandler) Discovered(name string, conn *tarantool.Connection,
@@ -1118,7 +1121,7 @@ func TestConnectionHandlerOpenUpdateClose(t *testing.T) {
11181121
err := test_helpers.SetClusterRO(makeDialers(poolServers), connOpts, roles)
11191122
require.Nilf(t, err, "fail to set roles for cluster")
11201123

1121-
h := &testHandler{}
1124+
h := &testHandler{t: t}
11221125
poolOpts := pool.Opts{
11231126
CheckTimeout: 100 * time.Microsecond,
11241127
ConnectionHandler: h,

test_helpers/pool_helper.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -202,8 +202,9 @@ func SetInstanceRO(ctx context.Context, dialer tarantool.Dialer, connOpts tarant
202202

203203
req := tarantool.NewCallRequest("box.cfg").
204204
Args([]interface{}{map[string]bool{"read_only": isReplica}})
205-
if _, err := conn.Do(req).Get(); err != nil {
206-
return err
205+
if resp, err := conn.Do(req).Get(); err != nil {
206+
// return err
207+
return fmt.Errorf("%w: resp: %v", err, resp)
207208
}
208209

209210
return nil
@@ -250,5 +251,5 @@ func StopTarantoolInstances(instances []*TarantoolInstance) {
250251
}
251252

252253
func GetPoolConnectContext() (context.Context, context.CancelFunc) {
253-
return context.WithTimeout(context.Background(), 500*time.Millisecond)
254+
return context.WithTimeout(context.Background(), 1000*time.Millisecond)
254255
}

0 commit comments

Comments
 (0)