-
-
Notifications
You must be signed in to change notification settings - Fork 505
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Fix flaky trap context spec * We really cannot use eager_load in tests This makes code loading so unstable that it makes no sense.
- Loading branch information
Showing
5 changed files
with
32 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# frozen_string_literal: true | ||
|
||
require_relative "../spec_helper" | ||
|
||
Sentry.init do |config| | ||
config.dsn = Sentry::TestHelper::DUMMY_DSN | ||
end | ||
|
||
trap('HUP') do | ||
hub = Sentry.get_main_hub | ||
puts hub.class | ||
end | ||
|
||
Process.kill('HUP', Process.pid) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# frozen_string_literal: true | ||
|
||
require_relative "../spec_helper" | ||
|
||
SimpleCov.command_name "RSpecIsolated" | ||
|
||
RSpec.describe Sentry do | ||
context "works within a trap context", when: { ruby_engine?: "ruby" } do | ||
it "doesn't raise error when accessing main hub in trap context" do | ||
out = `ruby spec/isolated/init.rb` | ||
|
||
expect(out).to include("Sentry::Hub") | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters