Skip to content

Commit

Permalink
Fixed and removed invalid Thread specs.
Browse files Browse the repository at this point in the history
A Thread can be in exactly three states via the methods that are available:
running, sleeping, and dead. Every other supposed state is a race condition
because there is no API to put the thread deterministically (ie, not as a
factor of some random scheduling artifact) into that state.
  • Loading branch information
brixen committed Apr 21, 2015
1 parent 2a09d43 commit 859756d
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 25 deletions.
12 changes: 0 additions & 12 deletions spec/ruby/core/thread/inspect_spec.rb
Expand Up @@ -30,19 +30,7 @@
ThreadSpecs.status_of_thread_with_uncaught_exception.inspect.should include('dead')
end

ruby_version_is ""..."1.9" do
it "describes a dying running thread" do
ThreadSpecs.status_of_dying_running_thread.inspect.should include('aborting')
end
end

it "describes a dying sleeping thread" do
ThreadSpecs.status_of_dying_sleeping_thread.status.should include('sleep')
end

quarantine! do
it "reports aborting on a killed thread" do
ThreadSpecs.status_of_aborting_thread.inspect.should include('aborting')
end
end
end
12 changes: 0 additions & 12 deletions spec/ruby/core/thread/status_spec.rb
Expand Up @@ -30,19 +30,7 @@
ThreadSpecs.status_of_thread_with_uncaught_exception.status.should == nil
end

ruby_version_is ""..."1.9" do
it "describes a dying running thread" do
ThreadSpecs.status_of_dying_running_thread.status.should == 'aborting'
end
end

it "describes a dying sleeping thread" do
ThreadSpecs.status_of_dying_sleeping_thread.status.should == 'sleep'
end

quarantine! do
it "reports aborting on a killed thread" do
ThreadSpecs.status_of_aborting_thread.status.should == 'aborting'
end
end
end
2 changes: 1 addition & 1 deletion spec/ruby/optional/capi/thread_spec.rb
Expand Up @@ -131,7 +131,7 @@ def call_capi_rb_thread_wakeup
thr.wakeup

# Make sure it stopped
thr.join(1).should_not be_nil
thr.join.should_not be_nil

# And we got a proper value
thr.value.should be_true
Expand Down

0 comments on commit 859756d

Please sign in to comment.