From 2d569e7bb8eb8bbe3c95aaf8f42555ceadea96cc Mon Sep 17 00:00:00 2001 From: Sven Anderson Date: Thu, 9 Nov 2023 15:26:14 +0100 Subject: [PATCH] check core dump (don't merge) --- .github/workflows/main.yml | 29 ++++++++++++++++------------- rados/conn.go | 4 ++-- rados/rados.go | 5 ++--- rados/rados_test.go | 23 ++++++++++++----------- 4 files changed, 32 insertions(+), 29 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index bbf828fef5..e526a26f25 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -59,27 +59,30 @@ jobs: fail-fast: false matrix: ceph_version: - - "nautilus" - - "octopus" + # - "nautilus" + # - "octopus" - "pacific" - - "quincy" - - "reef" - - "pre-quincy" - - "pre-reef" - - "main" + # - "quincy" + # - "reef" + # - "pre-quincy" + # - "pre-reef" + # - "main" go_version: - ${{ needs.go-versions.outputs.latest }} - include: - - ceph_version: "reef" - go_version: ${{ needs.go-versions.outputs.prev }} - - ceph_version: "reef" - go_version: ${{ needs.go-versions.outputs.unstable }} + # include: + # - ceph_version: "reef" + # go_version: ${{ needs.go-versions.outputs.prev }} + # - ceph_version: "reef" + # go_version: ${{ needs.go-versions.outputs.unstable }} steps: - uses: actions/checkout@v4 - name: Set cores to get stored as "core" run: sudo bash -c 'echo "core" > /proc/sys/kernel/core_pattern' - name: Run tests - run: make test-containers-test "CEPH_VERSION=${{ matrix.ceph_version }}" "GO_VERSION=${{ matrix.go_version }}" "RESULTS_DIR=$PWD/_results" + run: make test-container "CEPH_VERSION=${{ matrix.ceph_version }}" "GO_VERSION=${{ matrix.go_version }}" "RESULTS_DIR=$PWD/_results" "ENTRYPOINT_ARGS=--no-cover --test-pkg rados --test-run TestRadosTestSuite/TestAAA" + # - name: Setup tmate session + # if: failure() + # uses: mxschmitt/action-tmate@v3 - name: Clean up test containers if: always() run: make test-containers-clean "CEPH_VERSION=${{ matrix.ceph_version }}" diff --git a/rados/conn.go b/rados/conn.go index b866a796b6..fd0f118c24 100644 --- a/rados/conn.go +++ b/rados/conn.go @@ -6,6 +6,7 @@ package rados import "C" import ( + "runtime" "unsafe" "github.com/ceph/go-ceph/internal/cutil" @@ -47,14 +48,13 @@ func (c *Conn) PingMonitor(id string) (string, error) { var strlen C.size_t var strout *C.char - ret := C.rados_ping_monitor(c.cluster, cid, &strout, &strlen) defer C.rados_buffer_free(strout) - if ret == 0 { reply := C.GoStringN(strout, (C.int)(strlen)) return reply, nil } + runtime.KeepAlive(c.cluster) return "", getError(ret) } diff --git a/rados/rados.go b/rados/rados.go index 98d77ca8a3..734d14c677 100644 --- a/rados/rados.go +++ b/rados/rados.go @@ -7,7 +7,6 @@ package rados import "C" import ( - "runtime" "unsafe" "github.com/ceph/go-ceph/internal/log" @@ -74,7 +73,7 @@ func newConn(user *C.char) (*Conn, error) { return nil, getError(ret) } - runtime.SetFinalizer(conn, freeConn) + // runtime.SetFinalizer(conn, freeConn) return conn, nil } @@ -107,7 +106,7 @@ func NewConnWithClusterAndUser(clusterName string, userName string) (*Conn, erro return nil, getError(ret) } - runtime.SetFinalizer(conn, freeConn) + // runtime.SetFinalizer(conn, freeConn) return conn, nil } diff --git a/rados/rados_test.go b/rados/rados_test.go index d34abff72e..c1dffc46fd 100644 --- a/rados/rados_test.go +++ b/rados/rados_test.go @@ -455,19 +455,20 @@ func (suite *RadosTestSuite) TestGetLargePoolList() { } } -func (suite *RadosTestSuite) TestPingMonitor() { - suite.T().SkipNow() // until #921 is fixed +func (suite *RadosTestSuite) TestAAAPingMonitor() { suite.SetupConnection() + const N = 10000 + for i := 0; i < N; i++ { + // mon id that should work with vstart.sh + reply, err := suite.conn.PingMonitor("a") + assert.NoError(suite.T(), err) + assert.NotEqual(suite.T(), reply, "") - // mon id that should work with vstart.sh - reply, err := suite.conn.PingMonitor("a") - assert.NoError(suite.T(), err) - assert.NotEqual(suite.T(), reply, "") - - // invalid mon id - reply, err = suite.conn.PingMonitor("charlieB") - assert.Error(suite.T(), err) - assert.Equal(suite.T(), reply, "") + // invalid mon id + reply, err = suite.conn.PingMonitor("charlieB") + assert.Error(suite.T(), err) + assert.Equal(suite.T(), reply, "") + } } func (suite *RadosTestSuite) TestWaitForLatestOSDMap() {