aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/caching_test.rb
Commit message (Collapse)AuthorAgeFilesLines
* add check of argumentyuuji.yaginuma2016-09-171-0/+6
| | | | | | | `#fetch_multi` in case did not cache hit, to write a cache using the block value. https://github.com/rails/rails/blob/master/activesupport/lib/active_support/cache.rb#L383..L384 Therefore, block is a need to pass always, I think should check first.
* Merge pull request #25863 from mechanicles/remove-duplicate-testRafael França2016-08-161-5/+0
|\ | | | | Remove duplicate test.
| * Remove duplicate test.Santosh Wadghule2016-07-171-5/+0
| | | | | | | | | | We already test similar stuff in `test_really_long_keys` so removing this extra and duplicated test.
* | Add three new rubocop rulesRafael Mendonça França2016-08-161-11/+11
| | | | | | | | | | | | | | | | Style/SpaceBeforeBlockBraces Style/SpaceInsideBlockBraces Style/SpaceInsideHashLiteralBraces Fix all violations in the repository.
* | normalizes indentation and whitespace across the projectXavier Noria2016-08-061-7/+7
| |
* | remove redundant curlies from hash argumentsXavier Noria2016-08-061-3/+3
| |
* | modernizes hash syntax in activesupportXavier Noria2016-08-061-51/+51
| |
* | applies new string literal convention in activesupport/testXavier Noria2016-08-061-214/+214
| | | | | | | | | | The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default.
* | Merge pull request #25823 from mechanicles/missing-memory-store-testsRafael França2016-07-201-0/+10
|\ \ | | | | | | Add missing tests for memory store of cache.
| * | Add missing tests for memory store of cache.Santosh Wadghule2016-07-171-0/+10
| |/
* / Add missing test for clearing up local cache on invalid parameters err.Santosh Wadghule2016-07-171-0/+12
|/ | | | | Add missing test for clearing up local cache and check response should be present on invalid parameters error.
* Pathname might not be always initialized.Vít Ondruch2016-07-071-0/+2
| | | | Require 'pathname' explicitly
* Merge pull request #24577 from mechanicles/fix-fetch-cache-missJeremy Daer2016-04-181-0/+14
|\ | | | | | | Fix forced cache miss for fetch when called without a block.
| * Fix forced cache miss for fetch.Santosh Wadghule2016-04-181-0/+14
|/ | | | | | - Raised an argument error if no block is passed to #fetch with 'force: true' option is set. - Added tests for the same.
* remove args from assert_nothing_raised in testsTara Scherner de la Fuente2016-02-221-2/+2
|
* Revert "Instrument read_multi".Kasper Timm Hansen2016-02-201-9/+0
| | | | | | | | | | | | | | | | | | Reevaluating the log output generated from this instrumentation, we've found that it wasn't all that useful in practice. ``` Caches multi read: - views/david/2/4184ab71db6849621a4d8820fcd2c0ad - views/david/2/4184ab71db6849621a4d8820fcd2c0ad - views/david/3/4184ab71db6849621a4d8820fcd2c0ad - views/david/3/4184ab71db6849621a4d8820fcd2c0ad ``` If rendering many templates the output is inscrutable, and it's impossible to see how many cache misses there were. Revert ca6aba7f30 and implement a better way later.
* Merge pull request #22278 from poporul/masterGodfrey Chan2016-01-151-3/+5
|\ | | | | Allow to store .keep file in cache directory
| * Allow to store .keep file in cache directoryAlexey Pokhozhaev2015-11-131-3/+5
| |
* | Suppress warning ambiguous first argumentyui-knk2015-12-201-1/+1
| | | | | | | | | | Suppress warning (warning: ambiguous first argument; put parentheses or a space even after `/' operator)
* | Fix cache fetch miss notification orderRobin Clowers2015-12-021-12/+16
| | | | | | | | | | | | | | | | Fixes https://github.com/rails/rails/issues/22477. When I improved the caching instrumentation in edd33c08d98723ae9bb89cf7f019277117ed6414, I inadvertently changed the order of AS notifications when there is a cache miss.
* | add deprecations for a smooth transition after #22215Michael Grosser2015-11-191-0/+27
| |
* | send normalized keys to the cache backends so they do not need to manage ↵Michael Grosser2015-11-101-5/+5
|/ | | | this themselves
* do not override fetch on local cacheMichael Grosser2015-11-071-2/+9
| | | | | | fetch is supposed to behave differently, this was a mistake merged in https://github.com/rails/rails/pull/22194
* Merge pull request #22194 from grosser/grosser/read-nilSean Griffin2015-11-051-0/+8
|\ | | | | cache nil replies from backend cache so misses are fast too
| * cache nil replies from backend cache so misses are fast tooMichael Grosser2015-11-051-0/+8
| |
* | Merge pull request #11872 from AvnerCohen/log_namespaceSean Griffin2015-10-301-0/+13
|\ \ | | | | | | When testing cache issues, it is useful to log the actual key, including namespace
| * | When logging Cache key, in debug mode, also log namespace, to create the ↵Avner Cohen2015-06-231-0/+13
| | | | | | | | | | | | full key that actually used by the underline cache implementation
* | | Merge pull request #19889 from cedrics/long-uri-encoded-keysSean Griffin2015-10-201-0/+5
|\ \ \ | | | | | | | | FileStore: Long cache keys may result in too long paths due to encoding
| * | | when checking for too long cache keys used the uri encoded fname Cedric Sohrauer2015-04-241-0/+5
| | | |
* | | | Add test cases for Cache#fetch instrumentationRobin Clowers2015-09-141-0/+28
| |_|/ |/| |
* | | Removed use of mocha in active_supportRonak Jangir2015-07-101-31/+43
| | |
* | | remove bad test.Aaron Patterson2015-06-251-4/+0
| |/ |/|
* | Removed mocha stubbing in active_supportRonak Jangir2015-06-071-41/+51
| |
* | Avoid E constant clashing with Minitest defined version.Kasper Timm Hansen2015-05-221-8/+8
|/ | | | | Minitest sets an E constant to an empty string to save GC time. This clashes with autoloading tests which define an E constant.
* Allow AS::Cache::FileStore#clear without cache directoryKohei Suzuki2015-04-091-0/+6
| | | | | | Currently `Rails.cache.clear` raises Errno::ENOENT if it's run just after cloning a new Rails project. It should succeed without removing files or directories.
* Skip the `:race_condition_ttl` branch if the option is 0 or nil. This fixes ↵Matt Wilde2015-03-111-8/+20
| | | | an issue with the redis cache, where this code will sometimes throw an error out of SETEX when passing 0 as the `expires_at`.
* Remove not needed .tapArthur Neves2015-03-021-1/+1
|
* Do not output in the consoleRafael Mendonça França2015-03-021-1/+1
| | | | [Robin Dupret + Rafael Mendonça França]
* Instrument read_multi.Kasper Timm Hansen2015-02-211-0/+9
| | | | | | | | | | Adds `read_multi` instrumentation formatted as: Caches multi read: - views/david/2/4184ab71db6849621a4d8820fcd2c0ad - views/david/2/4184ab71db6849621a4d8820fcd2c0ad - views/david/3/4184ab71db6849621a4d8820fcd2c0ad - views/david/3/4184ab71db6849621a4d8820fcd2c0ad
* Remove conversion code for old Rails cache entryRafael Mendonça França2015-01-011-26/+0
| | | | | | | | | This code was there just to convert entries generated in Rails 4.0.0.beta1 applications to a supported format. It is almost unlikely that any existent application have this cache entry format in their caches at the point that Rails 5 will be released so we don't need this code anymore.
* Check by @v before converting the entry on expired?Rafael Mendonça França2015-01-011-1/+1
| | | | | | | We should convert when @v is defined not @value. The test was calling value first that already converts the entry so we are not catching this bug.
* Keep the first string we fetchMatthew Draper2014-08-271-1/+1
| | | | Otherwise, it's possible for GC to run in between, and fail the test.
* Create with_env helper for tests.Zuhao Wan2014-06-221-14/+13
|
* fix error with long keys in ActiveSupport::Cache::FileStoreAdam Panzer2014-06-101-0/+5
|
* Return a hash rather than array from fetch_multiParker Selbert2014-02-261-8/+9
| | | | | | | The current implementation of `fetch_multi` returns an array and has no means to easily backtrack which names yielded which results. By changing the return value to a Hash we retain the name information. Hash#values can be used on the response if only the values are needed.
* clear cache on body close so that cache remains during renderingAaron Patterson2014-01-081-0/+37
| | | | | | | | fixes #13547 The body may use the local cache during rendering. `call`ing the app doesn't mean that rendering is finished, so we need to wait until `close` is called on the body.
* Raise if MemCacheStore doenst receive a Dalli objArthur Neves2014-01-031-0/+8
| | | | | | :mem_cache_store should receive a list of hosts or a dalli client, otherwise raise it. Also adding a changelog.
* mem_cache_store requires dalli, so only accept dalli/clientArthur Neves2014-01-031-8/+0
| | | | | | | :mem_cache_store require dalli, rescue Dalli exceptions, and follow Dalli API. Memcached gem, for instance, doesnt work anymore, as the API are different. As we already require one client, we should make sure that client works, and not accept others, and if someone wants to use another memcache client they can write their own store adapter.
* Merge pull request #11785 from grosser/grosser/file-unless-existRafael Mendonça França2013-10-281-0/+7
|\ | | | | | | | | | | | | | | support :unless_exist for FileCache Conflicts: activesupport/CHANGELOG.md activesupport/test/caching_test.rb
| * support :unless_exist for FileCachegrosser2013-08-301-0/+7
| |