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


##########
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:
   this is only going to panic when the `assert` tag is present, which could be 
a problem.



-- 
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