Skip to content

Commit

Permalink
CI: Add a GC.stress run to our CI
Browse files Browse the repository at this point in the history
  • Loading branch information
larskanis committed Mar 31, 2024
1 parent 24143c4 commit 86d1363
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,23 @@ jobs:
env:
ITER: 10

gc_stress:
strategy:
fail-fast: false
matrix:
os: [ ubuntu ]
ruby: [ ruby-head ]
runs-on: ${{ matrix.os }}-latest
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}

- run: bundle install
- run: bundle exec rake libffi
- run: bundle exec rake compile test FFI_GC_STRESS=true

rcd_build:
name: build fat binary gems

Expand Down
11 changes: 11 additions & 0 deletions spec/ffi/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,14 @@ module OrderHelper
raise
end
end

if ENV['FFI_GC_STRESS'] == 'true'
RSpec.configure do |config|
config.before :each do
GC.stress=true
end
config.after :each do
GC.stress=false
end
end
end

0 comments on commit 86d1363

Please sign in to comment.