File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed
Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ def from_env(env)
1818 seed : env [ 'CIRCLE_SHA1' ] || env [ 'BUILDKITE_COMMIT' ] || env [ 'TRAVIS_COMMIT' ] || env [ 'HEROKU_TEST_RUN_COMMIT_VERSION' ] || env [ 'SEMAPHORE_GIT_SHA' ] ,
1919 flaky_tests : load_flaky_tests ( env [ 'CI_QUEUE_FLAKY_TESTS' ] ) ,
2020 statsd_endpoint : env [ 'CI_QUEUE_STATSD_ADDR' ] ,
21- redis_ttl : env [ 'CI_QUEUE_REDIS_TTL' ] ,
21+ redis_ttl : env [ 'CI_QUEUE_REDIS_TTL' ] &. to_i || 8 * 60 * 60 ,
2222 )
2323 end
2424
Original file line number Diff line number Diff line change @@ -65,6 +65,18 @@ def test_namespace
6565 assert_equal 'browser:9e08ef3c-d6e6-4a86-91dd-577ce5205b8e' , config . build_id
6666 end
6767
68+ def test_redis_ttl_defaults
69+ config = Configuration . new
70+ assert_equal ( 28_800 , config . redis_ttl )
71+ end
72+
73+ def test_redis_ttl_from_env
74+ config = Configuration . from_env (
75+ "CI_QUEUE_REDIS_TTL" => "14400"
76+ )
77+ assert_equal ( 14_400 , config . redis_ttl )
78+ end
79+
6880 def test_parses_file_correctly
6981 Tempfile . open ( 'flaky_test_file' ) do |file |
7082 file . write ( SharedTestCases ::TEST_NAMES . join ( "\n " ) + "\n " )
You can’t perform that action at this time.
0 commit comments