ComputeResourceCacheTest fails with empty file cache
In CI, the following test failure occurred with ComputeResourceCacheTest:
+ bundle exec rake pkg:generate_source jenkins:unit TESTOPTS=-v rm -rf jenkins/reports/unit/ The Apipie cache is turned off. Enable it and run apipie:cache rake task to speed up API calls. WARNING: `rake webpack:compile` failed to run. This is only important if running integration tests. (cause: Can't find our webpack executable at /var/lib/workspace/workspace/test_develop/database/mysql/ruby/2.1/slave/fast/node_modules/.bin/webpack - have you run `npm install`?) The Apipie cache is turned off. Enable it and run apipie:cache rake task to speed up API calls. * DEFERRED: MenuItem::MenuItem#caption should be tested. * DEFERRED: MenuItem::MenuItem#html_options should be tested. Run options: -v --ci-reporter --seed 27810 # Running: ComputeResourceCacheTest::with caching enabled#test_0001_it caches data = 1.03 s = E ComputeResourceCacheTest::with caching enabled#test_0003_#delete deletes keys from the cache = 0.00 s = E ComputeResourceCacheTest::with caching enabled#test_0004_#write and #read store and read data in the cache = 0.00 s = E ComputeResourceCacheTest::with caching enabled#test_0002_refresh the cache = 0.00 s = E Api::V2::TemplateKindsControllerTest#test_0001_should get index = 0.39 s = . LookupKeyTest::when key is a boolean and default_value is a string#test_0001_default_value is not validated if omit is true = 0.15 s = .
The test attempts to clear the cache in a
setup method, which resulted in:
1) Error: ComputeResourceCacheTest::with caching enabled#test_0001_it caches data: Errno::ENOENT: No such file or directory @ dir_initialize - /var/lib/workspace/workspace/test_develop/database/mysql/ruby/2.1/slave/fast/tmp/cache/paralleltests test/unit/compute_resource_cache_test.rb:5:in `block in <class:ComputeResourceCacheTest>'
This is already handled in the
reset_setting_cache setup/teardown methods in active_support_test_case_helper as the Rails cache may be missing on a clean checkout and when executing the very first tests.
The cache clear can be removed from ComputeResourceCacheTest and other similar test cases.