You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "zeroshade (via GitHub)" <gi...@apache.org> on 2023/07/13 21:08:03 UTC
[GitHub] [arrow] zeroshade commented on a diff in pull request #36676: MINOR: [Go] Test that we retain/release the right number of times
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-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org