Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Increase timeout for slow specs #13043

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion spec/std/exception_spec.cr
Expand Up @@ -35,7 +35,7 @@ describe "Exception" do
ex.inspect_with_backtrace.should contain("inner")
end

it "collect memory within ensure block" do
it "collect memory within ensure block", tags: %w[slow] do
sample = datapath("collect_within_ensure")

_, output, error = compile_and_run_file(sample, ["--release"])
Expand Down
11 changes: 8 additions & 3 deletions spec/support/mt_abort_timeout.cr
Expand Up @@ -15,12 +15,17 @@ Spec.around_each do |example|
end
end

timeout = SPEC_TIMEOUT
if example.example.all_tags.includes?("slow")
timeout *= 4
end

select
when res = done.receive
raise res if res
when timeout(SPEC_TIMEOUT)
when timeout(timeout)
_it = example.example
ex = Spec::AssertionFailed.new("spec timeout", _it.file, _it.line)
_it.parent.report(:fail, _it.description, _it.file, _it.line, SPEC_TIMEOUT, ex)
ex = Spec::AssertionFailed.new("spec timed out after #{timeout}", _it.file, _it.line)
_it.parent.report(:fail, _it.description, _it.file, _it.line, timeout, ex)
end
end