Rails V5 and Ruby 2.3.1 - tests completing slowly
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' Now when I time the output of this I get: Code:
$ time rails t 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? |
Although I am entirely(!) unfamiliar with "the present situation," I have definitely encountered this sort of [esoteric ...] problem before.
I suspect that your test ... condition encompasses an expectation that is not "entirely fulfilled" by "the entire block." Instead, it is fulfilled by just the first part of it ... which therefore is never actually seen(!). And so, the test block eventually times out. Your test block should encompass only "the thing that actually is to be tested," not any subsequent response to its success. The action assert_response :success should only occur if the test outcome is favorable. Therefore, it should follow that block, not be a part of it. |
I see where you are coming from, however, no test that I can create has any different results. Also, this test is directly from the course and when I previously used the course on version 4+ of rails I had no issues.
It is as though there is something else running after the test that I am unable to locate :( |
As a little extra, I have removed all tests and still have to wait 53+ seconds for the process to complete :( Obviously something else is running but I am buggered if I can see what :(
|
Okee dokee then ... I have found the cause and a work-around which gets me back to practicing :)
The problem stems from the addition of the following to my Gemfile: Code:
group :test do related to the gem that there is mention of some issues and although I tried the suggested solution, I was not able to overcome the extra time issue. As I do not intend to use guard this is a non-issue for me at the moment but I will continue to follow the solutions to see if I can update this question when a solution exists :) |
All times are GMT -5. The time now is 08:00 PM. |