From 60a9e46408ce34fca3f6556d1201bc209ed06d08 Mon Sep 17 00:00:00 2001 From: Sven Anderson Date: Thu, 21 Sep 2023 22:01:00 +0200 Subject: [PATCH] WIP --- rados/conn.go | 6 ++++-- rados/rados_test.go | 6 ------ 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/rados/conn.go b/rados/conn.go index 9e3553a16..89b822f18 100644 --- a/rados/conn.go +++ b/rados/conn.go @@ -43,19 +43,21 @@ func (c *Conn) Cluster() ClusterRef { // PingMonitor sends a ping to a monitor and returns the reply. func (c *Conn) PingMonitor(id string) (string, error) { + suite.T().Log("A") cid := C.CString(id) defer C.free(unsafe.Pointer(cid)) var strlen C.size_t var strout *C.char - + suite.T().Log("B") ret := C.rados_ping_monitor(c.cluster, cid, &strout, &strlen) defer C.rados_buffer_free(strout) - + suite.T().Log("C") if ret == 0 { reply := C.GoStringN(strout, (C.int)(strlen)) return reply, nil } + suite.T().Log("D") runtime.KeepAlive(c.cluster) return "", getError(ret) } diff --git a/rados/rados_test.go b/rados/rados_test.go index 2e278a743..4bbe01e0d 100644 --- a/rados/rados_test.go +++ b/rados/rados_test.go @@ -460,19 +460,13 @@ func (suite *RadosTestSuite) TestAAAPingMonitor() { const N = 1000 for i := 0; i < N; i++ { // mon id that should work with vstart.sh - suite.T().Log("A") reply, err := suite.conn.PingMonitor("a") - suite.T().Log("B") assert.NoError(suite.T(), err) - suite.T().Log("C") assert.NotEqual(suite.T(), reply, "") - suite.T().Log("D") // invalid mon id reply, err = suite.conn.PingMonitor("charlieB") - suite.T().Log("E") assert.Error(suite.T(), err) - suite.T().Log("F") assert.Equal(suite.T(), reply, "") } }