Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

In development and test we drain the jobs in the same thread.

  • Loading branch information...
commit fb0c845e92acfec771d9b6aca92585a957a5611f 1 parent aebbd4b
@rafaelfranca rafaelfranca authored
Showing with 4 additions and 4 deletions.
  1. +4 −4 railties/test/application/queue_test.rb
View
8 railties/test/application/queue_test.rb
@@ -47,7 +47,7 @@ def ran?
end
end
- test "in development mode, an enqueued job will be processed in a separate thread" do
+ test "in development mode, an enqueued job will be processed in the same thread" do
app("development")
job = ThreadTrackingJob.new
@@ -55,10 +55,10 @@ def ran?
sleep 0.1
assert job.ran?, "Expected job to be run"
- assert job.ran_in_different_thread?, "Expected job to run in the same thread"
+ refute job.ran_in_different_thread?, "Expected job to run in the same thread"
end
- test "in test mode, explicitly draining the queue will process it in a separate thread" do
+ test "in test mode, explicitly draining the queue will process it in the same thread" do
app("test")
Rails.queue.push ThreadTrackingJob.new
@@ -66,7 +66,7 @@ def ran?
Rails.queue.drain
assert job.ran?, "Expected job to be run"
- assert job.ran_in_different_thread?, "Expected job to run in a different thread"
+ refute job.ran_in_different_thread?, "Expected job to run in the same thread"
end
class IdentifiableJob
Please sign in to comment.
Something went wrong with that request. Please try again.