Skip to content

Commit 089a748

Browse files
committed
Added GC stress testing [skip ci]
1 parent d47e6e1 commit 089a748

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

test/test_helper.rb

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,23 @@
88
require "daru"
99

1010
class Minitest::Test
11+
def setup
12+
if stress?
13+
# autoload before GC.stress
14+
LightGBM::FFI.ffi_libraries
15+
load_data
16+
GC.stress = true
17+
end
18+
end
19+
20+
def teardown
21+
GC.stress = false if stress?
22+
end
23+
24+
def stress?
25+
ENV["STRESS"]
26+
end
27+
1128
def assert_elements_in_delta(expected, actual)
1229
assert_equal expected.size, actual.size
1330
expected.zip(actual) do |exp, act|

0 commit comments

Comments
 (0)