DEV: Increase timeout for JS tests and add env variable

DEV: Increase timeout for JS tests and add env variable

diff --git a/lib/tasks/docker.rake b/lib/tasks/docker.rake
index c6d3497..9c18850 100644
--- a/lib/tasks/docker.rake
+++ b/lib/tasks/docker.rake
@@ -13,6 +13,7 @@
 # => BISECT                    set to 1 to run rspec --bisect (applies to core rspec tests only)
 # => RSPEC_SEED                set to seed to use for rspec tests (applies to core rspec tests only)
 # => PAUSE_ON_TERMINATE        set to 1 to pause prior to terminating redis and pg
+# => JS_TIMEOUT                set timeout for qunit tests in ms
 #
 # Other useful environment variables (not specific to this rake task)
 # => COMMIT_HASH    used by the discourse_test docker image to load a specific commit of discourse
@@ -152,17 +153,19 @@ task 'docker:test' do
       end
 
       unless ENV["RUBY_ONLY"]
+        js_timeout = ENV["JS_TIMEOUT"].presence || 900_000 # 15 minutes
+
         puts "travis_fold:start:js_tests" if ENV["TRAVIS"]
         unless ENV["SKIP_CORE"]
-          @good &&= run_or_fail("bundle exec rake qunit:test['600000']")
-          @good &&= run_or_fail("bundle exec rake qunit:test['600000','/wizard/qunit']")
+          @good &&= run_or_fail("bundle exec rake qunit:test['#{js_timeout}']")
+          @good &&= run_or_fail("bundle exec rake qunit:test['#{js_timeout}','/wizard/qunit']")
         end
 
         unless ENV["SKIP_PLUGINS"]
           if ENV["SINGLE_PLUGIN"]
-            @good &&= run_or_fail("bundle exec rake plugin:qunit['#{ENV['SINGLE_PLUGIN']}','600000']")
+            @good &&= run_or_fail("bundle exec rake plugin:qunit['#{ENV['SINGLE_PLUGIN']}','#{js_timeout}']")
           else
-            @good &&= run_or_fail("bundle exec rake plugin:qunit['*','600000']")
+            @good &&= run_or_fail("bundle exec rake plugin:qunit['*','#{js_timeout}']")
           end
         end
         puts "travis_fold:end:js_tests" if ENV["TRAVIS"]

GitHub sha: 81108ee7

1 Like