Skip to content

Commit

Permalink
Tweak a flaky test
Browse files Browse the repository at this point in the history
  • Loading branch information
byroot committed Sep 25, 2023
1 parent 430dc05 commit 0ad7384
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
11 changes: 7 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@ jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
ruby:
- 2.7
- 3.0
- 3.1
- "2.7"
- "3.0"
- "3.1"
steps:
- uses: actions/checkout@v3
- name: Set up Ruby ${{ matrix.ruby }}
Expand All @@ -26,12 +27,14 @@ jobs:
bundle exec rake
lint:
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v3
- name: Set up Ruby 3.1
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.1
ruby-version: "3.1"
- name: Build
run: |
gem install bundler
Expand Down
5 changes: 2 additions & 3 deletions test/app_profiler/profile_server_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -85,15 +85,14 @@ class UNIXServerTest < ProfileServerTestCase

Transport = AppProfiler::Server.const_get(:ProfileServer)::Transport
test "servers are abandoned on fork" do
parent_socket = File.join(ProfileServer::PROFILER_TEMPFILE_PATH, "app-profiler-#{Process.pid}.sock")

server = AppProfiler::Server.start(@logger)
server.join(1)

open_servers = ObjectSpace.each_object(Transport).select { |t| !t.socket.closed? }
assert_equal(1, open_servers.size)

parent_socket = File.join(ProfileServer::PROFILER_TEMPFILE_PATH, "app-profiler-#{Process.pid}.sock")
assert_equal(true, File.exist?(parent_socket))

r, w = IO.pipe
pid = fork do
open_servers = ObjectSpace.each_object(Transport).select { |t| !t.socket.closed? }
Expand Down

0 comments on commit 0ad7384

Please sign in to comment.