Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Load time inaccurate #268

Closed
nilbus opened this issue Jun 3, 2014 · 8 comments
Closed

Load time inaccurate #268

nilbus opened this issue Jun 3, 2014 · 8 comments

Comments

@nilbus
Copy link

nilbus commented Jun 3, 2014

Using RSpec 3.0.0, I see the following when using guard-rspec:

Finished in 0.00392 seconds (files took 688 minutes 41 seconds to load)
4 examples, 0 failures

Really what happened was I started guard 688 minutes ago. Please see what you can do to cause this metric to reset on each guard run.

@e2
Copy link
Contributor

e2 commented Jun 3, 2014

Are you sure you're using guard-rspec = 4.2.9?

Do you have any overrides or special guard-rspec options in your Guardfile?

(Basically, that message is from Rspec, which sets the load time in Reporter.initialize, while guard-rspec just runs RSpec with a custom formatter in the command line).

@nilbus
Copy link
Author

nilbus commented Jun 3, 2014

Yes, I'm using 4.2.9 and also use --color and require the rails spec_helper.

I did a little more testing. After ripping out spring, this problem no longer occurs. This is happening because spring is forking the environment after the rspec Reporter has loaded.

Fixing this problem in guard-rspec seems somewhat inappropriate, as it would require monkeypatching that would easily break as rspec changes. That said, maybe we can figure out what the right solution is and suggest changes in those projects. Ideas?

@907th
Copy link
Contributor

907th commented Jun 3, 2014

@nilbus Are you using spring-commands-rspec?

@907th
Copy link
Contributor

907th commented Jun 3, 2014

@nilbus Maybe you'd better report the issue to spring-commands-rspec maintainer

@e2
Copy link
Contributor

e2 commented Jun 3, 2014

I'd say this is an issue in Rspec, not because the metric isn't correct (it actually is - no matter how you look at it), but because currently the metric simply doesn't make sense with spring.

So I would report it as a RSpec bug, because if the value doesn't make sense in some cases, it either shouldn't be shown, or should say what makes sense. (The idea of that metric has to be revisited).

If it bothers you, you could just use a custom formatter that doesn't show the info - and that is something you could do with a patch in guard-rspec, although it only hides the problem.

@nilbus
Copy link
Author

nilbus commented Jun 3, 2014

@e2 I agree and will report this upstream with rspec.

@907th Thanks for bringing up spring-commands-rspec. I found that if I run bin/rspec, I see the same incorrect behavior, even when running outside of guard.

Thanks for helping me troubleshoot!

@nilbus nilbus closed this as completed Jun 3, 2014
@zorab47
Copy link

zorab47 commented Jun 18, 2014

Just for reference spring-commands-rspec is where the issued landed: jonleighton/spring-commands-rspec#18

@907th
Copy link
Contributor

907th commented Jun 18, 2014

@zorab47 Ok, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants