Commit Graph

32 Commits

Author SHA1 Message Date
lvl0nax
517cf249c3
Chomp: prefer String#chomp where we can for a clarity boost
Closes #24766, #24767

Signed-off-by: Jeremy Daer <jeremydaer@gmail.com>
2016-04-29 13:43:15 -07:00
Jeremy Daer
75097933e2 Merge pull request #23966 from jeremy/activejob/pare-down-async-adapter-for-low-footprint-dev
Active Job: pare down async adapter for low footprint dev
2016-03-01 00:19:20 -07:00
Jeremy Daer
a66780bfff Active Job: smaller footprint for the dev/test async adapter
Use one shared worker pool for all queues with 0-#CPU workers rather
than separate pools per queue with 2-10*#CPU workers each.
2016-02-29 15:58:26 -07:00
Mohit Natoo
dec21eb5f6 - Updating the dummy app template to have rails_command instead of rake 2016-03-01 02:39:43 +05:30
Rafael Mendonça França
2c131141ca Remove celluloid from the Gemfile 2016-01-27 15:44:26 -05:00
Will Jessop
171e788ccd Fix race condition testing for job execution order
On most filesystems file ctime is limited to 1 second granularity, which means that on
faster computers multiple simple jobs (for instance dummy TestJob) can finish within the
same second.

The execution order test in ActiveJob integration tests relies on multiple TestJobs
writing files then comparing the ctime. As a result integration tests would sometimes
fail as the ctime of the files written by these TestJobs could have coincidental ctimes
making the comparison for job order fail.

This commit adds a far more precise execution time (to the extent that the Ruby Time
class allows) to the file created by TestJob, and updates the execution order assertion
to use it, removing the race condition.
2015-11-23 14:24:49 +00:00
Rafael Mendonça França
0f89e15e80 Merge pull request #19425 from wvengen/feature/activejob-priority-master
Add job priorities to ActiveJob
2015-09-25 23:50:33 -03:00
Andrew White
a22523abcd Use Sidekiq.options to set initial wait
The INITIAL_WAIT constant has moved to the Sidekiq::Poller class but
rather than setting the constant directly we can override it via the
`:poll_interval_average` option.

This was causing random build failures because the test was waiting
for 10 seconds for the job to execute but the initial wait was a
random value between 10 and 15 seconds.
2015-09-21 14:02:41 +01:00
Andrew White
2e501ac9c4 Run rake db:migrate for all Active Job integration tests
If db/schema.rb doesn't exist then we get warnings from the dummy Rails
application so run it for all adapters even if they're not using the
database to store jobs.
2015-09-21 14:02:41 +01:00
hiren mistry
4e2c43b082 Added new lines to run title for easy log reading 2015-09-19 15:10:14 -07:00
wvengen
7059ab35f7 Add job priorities to ActiveJob 2015-09-17 22:17:39 +02:00
Jerry D'Antonio
25a4155257 Initial implementation of ActiveJob AsyncAdapter. 2015-08-25 14:22:11 -04:00
yuuji.yaginuma
e875273ebc use average_scheduled_poll_interval option instead of deprecated poll_interval
this removes the following warning:

```
DEPRECATION: `config.poll_interval = 0.5` will be removed in Sidekiq 4. Please update to `config.average_scheduled_poll_interval = 0.5`.
```
2015-08-15 22:41:46 +09:00
Johannes Opper
3860e6b2bf Fixes #20799
When `#perform_later` is called the locale isn't stored on the
queue, which results in a locale reset when the job is performed.

An example of the problem:

    I18n.locale = 'de'
    HelloJob.perform_now # german message, correct

but

    I18n.locale = 'de'
    HelloJob.perform_later # english message, incorrect

This PR attaches the current I18n.locale to every job during the
serialization process. It is then restored during deserialization
and used to perform the job with the correct locale.

It falls back to the default locale if no serialized locale is
found in order to provide backward compatibility with previously
stored jobs. It is not necessary to clear the queue for the update.
2015-08-04 00:38:18 +02:00
Kevin Deisz
221a411fd7 Provide provider_job_id to qu adapter.
Further work to provide provider_job_id for queue adapters.
2015-05-07 19:17:22 -04:00
Rafael Mendonça França
5d83d111f5 Do not use named queues for que adapter
See #19498
2015-05-03 18:01:57 -03:00
Matthew Draper
8b09b45458 Only *configure* the queue in setup; DB creation must come later
setup gets called from the initializer, so it happens more than once in
a test run. Trying to drop the database again after the first process is
connected is.. ineffective. And entirely pointless.

Instead, defer creating the database to start_workers -- which only
happens once, right before we start doing anything real.
2015-04-20 09:14:19 +09:30
Matthew Draper
41ae432f49 Shuffle a few things in aid of easier debugging
* Don't swallow output -- if there is any, it's probably useful
* Wait for the process to finish
* Use IPC instead of a sleep
* No need for a pidfile
2015-04-20 08:50:24 +09:30
Matthew Draper
2ca8545e51 Fix sidekiq test order dependency
Requiring sidekiq/testing changes stuff, so we need to counteract that
after we do so.

And given its potential to confuse things, let's do it up front, at a
predictable point.
2015-04-20 08:21:15 +09:30
Takumi IINO
b126e7aaaa avoid double initialization error caused to sidekiq
Sidekiq::CLI#boot_system require "#{dummy_app_path}/config/environment.rb".
But this file has already been required in'test/support/integration/helper.rb'.
This patch will change to use Sidekiq::Launcher directly.
2015-04-14 13:06:20 -04:00
Brandon Weiss
0965863564 Closes rails/rails#18864: Renaming transactional fixtures to transactional tests
I’m renaming all instances of `use_transcational_fixtures` to
`use_transactional_tests` and “transactional fixtures” to
“transactional tests”.

I’m deprecating `use_transactional_fixtures=`. So anyone who is
explicitly setting this will get a warning telling them to use
`use_transactional_tests=` instead.

I’m maintaining backwards compatibility—both forms will work.
`use_transactional_tests` will check to see if
`use_transactional_fixtures` is set and use that, otherwise it will use
itself. But because `use_transactional_tests` is a class attribute
(created with `class_attribute`) this requires a little bit of hoop
jumping. The writer method that `class_attribute` generates defines a
new reader method that return the value being set. Which means we can’t
set the default of `true` using `use_transactional_tests=` as was done
previously because that won’t take into account anyone using
`use_transactional_fixtures`. Instead I defined the reader method
manually and it checks `use_transactional_fixtures`. If it was set then
it should be used, otherwise it should return the default, which is
`true`. If someone uses `use_transactional_tests=` then it will
overwrite the backwards-compatible method with whatever they set.
2015-03-16 11:35:44 -07:00
Tamir Duberstein
fb26645c1e ActiveJob::QueueAdapters::* are no longer singletons 2015-03-11 15:58:41 -07:00
Cristian Bica
cb786219f4 Fixed ActiveJob integration tests 2015-03-05 23:57:57 +02:00
Jeroen van Baarsen
e380ac685b Changed the AJADAPTER to AJ_ADAPTER
* This allows for easier reading, since those are two words, so they should be
  split by _

Signed-off-by: Jeroen van Baarsen <jeroenvanbaarsen@gmail.com>
2015-02-22 16:11:21 +01:00
robertomiranda
ce8efcf296 Use public Module#include, in favor of https://bugs.ruby-lang.org/issues/8846
ref: https://github.com/rails/rails/pull/18763#issuecomment-72349769
2015-01-31 23:12:41 -05:00
Rafael Mendonça França
aab670b430 redis 3.2.0 doesn't allow tcp protocol anymore
Use redis protocol
2014-12-13 00:06:31 -02:00
Rafael Mendonça França
191ea4b85b Merge pull request #17825 from aripollak/fix-activejob-sidekiq-integration
Fix Sidekiq ActiveJob integration setup

Conflicts:
	activejob/test/support/integration/adapters/sidekiq.rb
2014-12-04 18:24:23 -02:00
Erik Michaels-Ober
d1374f99bf Pass symbol as an argument instead of a block 2014-11-29 11:53:24 +01:00
Ari Pollak
2fa4cbeebd Fix Sidekiq ActiveJob integration setup
* .connect on a Redis connection wasn't valid
* Reset logger after we're done testing for redis connection to avoid
  "closed stream" error when starting server for real from a fork
2014-11-28 17:18:32 -05:00
Vipul A M
8660853770 - Removed unused variable warnings from ActiveJob Adapters 2014-10-19 23:17:22 +05:30
Matthew Draper
d7a058f785 Make AJ integration tests much less verbose
In passing, avoid a blind retry in QC: instead, just fix the problem.
2014-09-27 21:59:10 +09:30
Cristian Bica
175ba66664 ActiveJob Integration Tests 2014-09-11 00:38:56 +03:00