I have been going over some old courses on rails which have updated to the new version (5).
I am up to the first section on testing and have come across a strange timing that I cannot explain
So here is my super simple test code:
Code:
require 'test_helper'
class StaticPagesControllerTest < ActionDispatch::IntegrationTest
test "should get root" do
get root_url
assert_response :success
end
end
As you can see it is a simple test to see if the root_url is returning successfully.
Now when I time the output of this I get:
Code:
$ time rails t
Started with run options --seed 38470
1/1: [======================================================================================================================================================================] 100% Time: 00:00:00, Time: 00:00:00
Finished in 0.49690s
1 tests, 1 assertions, 0 failures, 0 errors, 0 skips
real 0m54.209s
user 0m3.450s
sys 0m0.397s
Here we see that the actual test took less than half a second (see 'Finished in' time), but that the whole command took a whopping 54+ seconds to complete
I have tried searching for a reason but I am only able to find optimization options instead of a reason why there is an additional 53 seconds (rounded) to complete the command after the tests have finished.
If anyone can point me in the direction of an answer it would be much appreciated
Please also let me know if there is any other detail to be provided to help with a solution?