Skip to content

Commit 2cf4996

Browse files
committed
test: make default GC behavior "normal"
I'm getting frustrated with long CI run timesxs
1 parent 1580121 commit 2cf4996

File tree

2 files changed

+5
-9
lines changed

2 files changed

+5
-9
lines changed

CONTRIBUTING.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ bundle exec rake compile test:memcheck
170170
```
171171

172172

173-
Note that by default the test suite will run a major GC after each test completes. This has shown to be useful for localizing some classes of memory bugs, but does slow the suite down. Some variations of the test suite behavior are available (see `test/helper.rb` for more info):
173+
Note that by you can run the test suite with a variety of GC behaviors. For example, running a major after each test completes has, on occasion, been useful for localizing some classes of memory bugs, but does slow the suite down. Some variations of the test suite behavior are available (see `test/helper.rb` for more info):
174174

175175
``` sh
176176
# see failure messages immediately

test/helper.rb

+4-8
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
# Some environment variables that are used to configure the test suite:
55
# - NOKOGIRI_TEST_FAIL_FAST: if set to anything, emit test failure messages immediately upon failure
66
# - NOKOGIRI_TEST_GC_LEVEL: (roughly in order of stress)
7-
# - "normal" - normal GC functionality
7+
# - "normal" - normal GC functionality (default)
88
# - "minor" - force a minor GC cycle after each test
9-
# - "major" (default for Rubies without compaction) - force a major GC cycle after each test
10-
# - "compact" (default for Rubies with compaction) - force a major GC after each test and GC compaction after every 20 tests
9+
# - "major" - force a major GC cycle after each test
10+
# - "compact" - force a major GC after each test and GC compaction after every 20 tests
1111
# - "verify" - force a major GC after each test and verify references-after-compaction after every 20 tests
1212
# - "stress" - run tests with GC.stress set to true
1313
# - NOKOGIRI_GC: read more in test/test_memory_leak.rb
@@ -144,12 +144,8 @@ def initialize_nokogiri_test_gc_level
144144
"compact"
145145
elsif (ENV["NOKOGIRI_TEST_GC_LEVEL"] == "verify") && defined?(GC.verify_compaction_references)
146146
"verify"
147-
elsif RUBY_ENGINE == "truffleruby"
148-
"normal"
149-
elsif defined?(GC.compact)
150-
"compact"
151147
else
152-
"major"
148+
"normal"
153149
end
154150

155151
if ["compact", "verify"].include?(@@gc_level)

0 commit comments

Comments
 (0)