zeroshade commented on code in PR #36676:
URL: https://github.com/apache/arrow/pull/36676#discussion_r1263794261


##########
go/arrow/cdata/cdata_test.go:
##########
@@ -769,6 +769,21 @@ func TestExportRecordReaderStream(t *testing.T) {
        assert.EqualValues(t, len(reclist), i)
 }
 
+func TestExportRecordReaderStreamLifetime(t *testing.T) {
+       reclist := arrdata.Records["primitives"]
+       rdr, _ := array.NewRecordReader(reclist[0].Schema(), reclist)
+
+       out := createTestStreamObj()
+       ExportRecordReader(rdr, out)
+       releaseStream(out)
+
+       // Release once
+       rdr.Release()
+
+       // Should panic (we have no other way of checking reference count)
+       assert.Panics(t, func() { rdr.Release() })

Review Comment:
   The better way of testing it would be to use the checked allocator and test 
records that are allocated with the checked allocator with a `defer 
mem.AssertSize(t, 0)` like we do in other areas



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscr...@arrow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to