Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crashing TestPingMonitor #923

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 16 additions & 13 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}"
Expand Down
4 changes: 2 additions & 2 deletions rados/conn.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ package rados
import "C"

import (
"runtime"
"unsafe"

"github.com/ceph/go-ceph/internal/cutil"
Expand Down Expand Up @@ -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)
}

Expand Down
5 changes: 2 additions & 3 deletions rados/rados.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ package rados
import "C"

import (
"runtime"
"unsafe"

"github.com/ceph/go-ceph/internal/log"
Expand Down Expand Up @@ -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
}

Expand Down Expand Up @@ -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
}

Expand Down
23 changes: 12 additions & 11 deletions rados/rados_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
Loading