Skip to content

Commit d5ec308

Browse files
authored
ci: ensure extra GC cycle for flaky tests (#661)
### Rationale for this change Fix flakiness in test ### What changes are included in this PR? Ensure extra GC cycle for bloomfilter test
1 parent 970ca6b commit d5ec308

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

parquet/metadata/bloom_filter_reader_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ func (suite *BloomFilterBuilderSuite) TestSingleRowGroup() {
127127
suite.True(bf1.CheckHash(metadata.GetHash(bf1.Hasher(), parquet.ByteArray("Hello"))))
128128
}
129129
runtime.GC() // force GC to run to put the buffer back into the pool
130+
runtime.GC() // finalizers need two GC cycles to run reliably
130131
{
131132
bf2, err := bfr.GetColumnBloomFilter(1)
132133
suite.Require().NoError(err)
@@ -140,8 +141,10 @@ func (suite *BloomFilterBuilderSuite) TestSingleRowGroup() {
140141
suite.True(bf3.CheckHash(metadata.GetHash(bf3.Hasher(), parquet.ByteArray("World"))))
141142
}
142143
runtime.GC() // we're using setfinalizer, so force release
144+
runtime.GC() // finalizers need two GC cycles to run reliably
143145
}
144146
runtime.GC()
147+
runtime.GC() // finalizers need two GC cycles to run reliably
145148
}
146149

147150
const (
@@ -189,6 +192,7 @@ func (suite *EncryptedBloomFilterBuilderSuite) SetupTest() {
189192

190193
func (suite *EncryptedBloomFilterBuilderSuite) TearDownTest() {
191194
runtime.GC() // we use setfinalizer to clean up the buffers, so run the GC
195+
runtime.GC() // finalizers need two GC cycles to run reliably
192196
suite.mem.AssertSize(suite.T(), 0)
193197
}
194198

0 commit comments

Comments
 (0)