summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2019-05-29 13:26:27 +0200
committerDavid Rodríguez <deivid.rodriguez@riseup.net>2019-05-29 15:50:18 +0200
commitdce79b1efa4fffea9abb8fa6b64a959b1df11f34 (patch)
tree00a38fe373501a2c10f0df975a01c0faa07c42ae
parent685208e53764d78e746755ffe02618970dcd9a08 (diff)
downloadbundler-debug_flaky_test_failures.tar.gz
Add debugging information to flaky testdebug_flaky_test_failures
-rw-r--r--spec/bundler/fetcher/compact_index_spec.rb7
1 files changed, 5 insertions, 2 deletions
diff --git a/spec/bundler/fetcher/compact_index_spec.rb b/spec/bundler/fetcher/compact_index_spec.rb
index 5a2d22193a..2f622f6653 100644
--- a/spec/bundler/fetcher/compact_index_spec.rb
+++ b/spec/bundler/fetcher/compact_index_spec.rb
@@ -11,11 +11,14 @@ RSpec.describe Bundler::Fetcher::CompactIndex do
end
describe "#specs_for_names" do
+ let(:thread_list) { Thread.list.select {|thread| thread.status == "run" } }
+ let(:thread_inspection) { thread_list.map {|th| " * #{th}:\n #{th.backtrace_locations.join("\n ")}" }.join("\n") }
+
it "has only one thread open at the end of the run" do
compact_index.specs_for_names(["lskdjf"])
- thread_count = Thread.list.count {|thread| thread.status == "run" }
- expect(thread_count).to eq 1
+ thread_count = thread_list.count
+ expect(thread_count).to eq(1), "Expected 1 active thread after `#specs_for_names`, but found #{thread_count}. In particular, found:\n#{thread_inspection}"
end
it "calls worker#stop during the run" do