aboutsummaryrefslogtreecommitdiffstats
path: root/activejob/test/support
Commit message (Collapse)AuthorAgeFilesLines
* Fix race condition testing for job execution orderWill Jessop2015-11-232-6/+17
| | | | | | | | | | | | | | | 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.
* Merge pull request #19425 from wvengen/feature/activejob-priority-masterRafael Mendonça França2015-09-252-2/+7
|\ | | | | Add job priorities to ActiveJob
| * Add job priorities to ActiveJobwvengen2015-09-172-2/+7
| |
* | Use Sidekiq.options to set initial waitAndrew White2015-09-211-1/+1
| | | | | | | | | | | | | | | | | | | | 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.
* | Run `rake db:migrate` for all Active Job integration testsAndrew White2015-09-211-1/+2
| | | | | | | | | | | | 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.
* | Added new lines to run title for easy log readinghiren mistry2015-09-191-1/+1
|/
* Initial implementation of ActiveJob AsyncAdapter.Jerry D'Antonio2015-08-251-0/+9
|
* use `average_scheduled_poll_interval` option instead of deprecated ↵yuuji.yaginuma2015-08-151-1/+1
| | | | | | | | | | `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`. ```
* Fixes #20799Johannes Opper2015-08-042-1/+9
| | | | | | | | | | | | | | | | | | | | | | 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.
* Provide provider_job_id to qu adapter.Kevin Deisz2015-05-071-2/+2
| | | | Further work to provide provider_job_id for queue adapters.
* Do not use named queues for que adapterRafael Mendonça França2015-05-031-1/+1
| | | | See #19498
* Merge pull request #19498 from chanks/activejob-que-remove-named-queuesRafael Mendonça França2015-05-031-1/+5
|\ | | | | ActiveJob: Stop using Que's named queues.
| * Stop using Que's named queues in its ActiveJob adapter.Chris Hanks2015-03-241-1/+5
| |
* | Only *configure* the queue in setup; DB creation must come laterMatthew Draper2015-04-202-21/+25
| | | | | | | | | | | | | | | | | | 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.
* | Shuffle a few things in aid of easier debuggingMatthew Draper2015-04-201-20/+36
| | | | | | | | | | | | | | * 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
* | Fix sidekiq test order dependencyMatthew Draper2015-04-201-0/+3
| | | | | | | | | | | | | | | | 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.
* | avoid double initialization error caused to sidekiqTakumi IINO2015-04-141-13/+34
|/ | | | | | 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.
* Closes rails/rails#18864: Renaming transactional fixtures to transactional testsBrandon Weiss2015-03-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | 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.
* `ActiveJob::QueueAdapters::*` are no longer singletonsTamir Duberstein2015-03-111-2/+2
|
* Fixed ActiveJob integration testsCristian Bica2015-03-052-2/+4
|
* Changed the AJADAPTER to AJ_ADAPTERJeroen van Baarsen2015-02-223-3/+3
| | | | | | | * 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>
* Use public Module#include, in favor of https://bugs.ruby-lang.org/issues/8846robertomiranda2015-01-311-1/+1
| | | | ref: https://github.com/rails/rails/pull/18763#issuecomment-72349769
* redis 3.2.0 doesn't allow tcp protocol anymoreRafael Mendonça França2014-12-131-1/+1
| | | | Use redis protocol
* Merge pull request #17825 from aripollak/fix-activejob-sidekiq-integrationRafael Mendonça França2014-12-041-1/+2
|\ | | | | | | | | | | | | Fix Sidekiq ActiveJob integration setup Conflicts: activejob/test/support/integration/adapters/sidekiq.rb
| * Fix Sidekiq ActiveJob integration setupAri Pollak2014-11-281-1/+2
| | | | | | | | | | | | * .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
* | Pass symbol as an argument instead of a blockErik Michaels-Ober2014-11-292-4/+2
|/
* - Removed unused variable warnings from ActiveJob AdaptersVipul A M2014-10-195-5/+5
|
* Make AJ integration tests much less verboseMatthew Draper2014-09-278-26/+14
| | | | In passing, avoid a blind retry in QC: instead, just fix the problem.
* ActiveJob Integration TestsCristian Bica2014-09-1114-0/+521
|
* ActiveJob: Implemented enqueue_at for QueueClassicCristian Bica2014-09-021-0/+12
|
* [ActiveJob] extract JobBuffer from helperAbdelkader Boudih2014-08-291-0/+19
|
* Added enqueue_at support for QueAdapter in ActiveJobNicholas Bruning2014-08-211-0/+9
| | | | | * Added inline job runner for Que in test/support * Updated QueAdapter to support enqueue_at
* Remove activejob integration testsAbdelkader Boudih2014-08-1212-208/+0
|
* Add 'activejob/' from commit '14f74a8331f94150dfee653224de8fc837797709'Abdelkader Boudih2014-08-1217-0/+352
git-subtree-dir: activejob git-subtree-mainline: b45b99894a60eda434abec94d133a1cfd8de2dda git-subtree-split: 14f74a8331f94150dfee653224de8fc837797709