aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/connection_management_test.rb
Commit message (Collapse)AuthorAgeFilesLines
* Change the empty block style to have space inside of the blockRafael Mendonça França2018-09-251-1/+1
|
* Use assert_predicate and assert_not_predicateDaniel Colson2018-01-251-6/+6
|
* Use respond_to test helpersDaniel Colson2018-01-251-1/+1
|
* Use frozen-string-literal in ActiveRecordKir Shatrov2017-07-191-0/+2
|
* Revert "Merge pull request #29540 from kirs/rubocop-frozen-string"Matthew Draper2017-07-021-1/+0
| | | | | This reverts commit 3420a14590c0e6915d8b6c242887f74adb4120f9, reversing changes made to afb66a5a598ce4ac74ad84b125a5abf046dcf5aa.
* Enforce frozen string in RubocopKir Shatrov2017-07-011-0/+1
|
* Add three new rubocop rulesRafael Mendonça França2016-08-161-1/+1
| | | | | | | | Style/SpaceBeforeBlockBraces Style/SpaceInsideBlockBraces Style/SpaceInsideHashLiteralBraces Fix all violations in the repository.
* applies new string literal convention in activerecord/testXavier Noria2016-08-061-4/+4
| | | | | The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default.
* Do not attempt to return connection with open transaction to pool (#24610)Sean Griffin2016-04-221-5/+7
| | | | | | | | | | | | | When the query cache completes, if Active Record is still inside of a transaction, it is because the transaction is meant to be left open above this unit of work (such as transactional fixtures in tests). There were several tests around the behavior of "tests" that were invalid, as tests are not run through the executor. They have been changed to reflect the new behavior, which is closer to what actually occurs in Rails tests. Fixes #23989 Fixes #24491 Close #24500
* Publish AS::Executor and AS::Reloader APIsMatthew Draper2016-03-021-30/+34
| | | | | | These should allow external code to run blocks of user code to do "work", at a similar unit size to a web request, without needing to get intimate with ActionDipatch.
* Fix wrong `assert_equal` argument order.Kasper Timm Hansen2015-11-071-2/+2
| | | | | It goes expected, then actual. Only changed this because the file was just touched (please don't submit pull requests :)).
* Suppress warning (warning about assigned but unused variable)yui-knk2015-11-071-1/+1
| | | | | These warings have been appeared from https://github.com/rails/rails/commit/92bc8cdb0771bf6ffcfb31ef58dba529527b514c
* Avoids mutating the original response in connection management middlewareKevin Buchanan2015-11-061-0/+7
|
* Add schema cache to new connection pool after forkEugene Kenny2015-05-171-23/+0
| | | | | | | | | | | | | | Active Record detects when the process has forked and automatically creates a new connection pool to avoid sharing file descriptors. If the existing connection pool had a schema cache associated with it, the new pool should copy it to avoid unnecessarily querying the database for its schema. The code to detect that the process has forked is in ConnectionHandler, but the existing test for it was in the ConnectionManagement test file. I moved it to the right place while I was writing the new test for this change.
* Fix typos and improve the documentationJon Atack2015-04-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a squash of the following commits, from first to last: - Fix minor, random things I’ve come across lately that individually did not seem worth making a PR for, so I saved them for one commit. One common error is using “it’s” (which is an abbreviation of “it is”) when the possessive “its” should be used for indicating possession. - Changes include the name of a test, so remove the `[skip ci]` (thanks @senny). - Line wrap the changes at 80 chars and add one more doc fix. - Add a missing line wrap in the Contributing to Ruby on Rails Guide. - Line wrap the `TIP` section in the Contributing to Ruby on Rails Guide as well. Rendering the guide locally with `bundle exec rake guides:generate` did not show any change in on-screen formatting after adding the line wrap. The HTML generated is (extra line added to illustrate where the line wrap takes place): <div class="info"><p>Please squash your commits into a single commit when appropriate. This simplifies future cherry picks and also keeps the git log clean.</p></div> - Squash commits.
* ar/connection_pool: honor overriden rack.test in middlewareSimon Eskildsen2014-09-231-0/+8
| | | | | | | Honoring an overidden `rack.test` allows testing closed connection between multiple requests. This is useful if you're working on database resiliency, to ensure the connection is in the expected state from one request to another on the same worker.
* set encoding to binmode for pipeAnna Carey2014-01-171-0/+2
|
* Don't skip tests if we don't need to.Rafael Mendonça França2013-11-081-14/+14
| | | | | | | We can conditional define the tests depending on the adapter or connection. Lets keep the skip for fail tests that need to be fixed.
* rescue from all exceptions in `ConnectionManagement#call`Vipul A M2013-07-221-2/+2
| | | | | | | | | Fixes #11497 As `ActiveRecord::ConnectionAdapters::ConnectionManagement` middleware does not rescue from Exception (but only from StandardError), the Connection Pool quickly runs out of connections when multiple erroneous Requests come in right after each other. Recueing from all exceptions and not just StandardError, fixes this behaviour.
* database connections are automatically established after forking.Aaron Patterson2012-02-161-0/+21
| | | | Connection pools are 1:1 with pids.
* use Rack::BodyProxy in activerecord middlewaresSergey Nartimov2012-01-161-3/+5
|
* Move connection resoluion logic to it's own testable class.Aaron Patterson2011-11-281-34/+0
|
* break establish_connection to smaller methodsAaron Patterson2011-11-281-3/+3
|
* adding more tests around database uri parsingAaron Patterson2011-07-211-0/+34
|
* Fix inconsistencies by being polite to the wrapped body. Needed for ↵Steve Hodgkiss2011-06-181-0/+7
| | | | Rack::Sendfile to function properly. See issue #1761.
* please use ruby -I lib:test path/to/test.rb, or export RUBY_OPTAaron Patterson2011-06-061-1/+1
|
* Refactor Active Record test connection setup. Please see the ↵Jon Leighton2011-06-041-1/+1
| | | | RUNNING_UNIT_TESTS file for details, but essentially you can now configure things in test/config.yml. You can also run tests directly via the command line, e.g. ruby path/to/test.rb (no rake needed, uses default db connection from test/config.yml). This will help us fix the CI by enabling us to isolate the different Rails versions to different databases.
* make sure that active connections are not cleared during test when an ↵Aaron Patterson2011-03-291-0/+8
| | | | exception happens
* clearing active connections in the ConnectionManagement middleware if an ↵Aaron Patterson2011-03-291-0/+7
| | | | exception happens
* proxy body responses so we close database connections after body is flushedAaron Patterson2011-03-291-2/+22
|
* make sure we have an active database connection before running each ↵Aaron Patterson2011-03-281-4/+5
| | | | connection management test
* testing app delegation from the ConnectionManagement middlewareAaron Patterson2011-03-281-3/+20
|
* namespacing connection management tests. :heart:Aaron Patterson2011-03-281-18/+22
|
* fixing test file nameAaron Patterson2010-07-161-0/+25