While running some specs of a new fresh Rails 3.1 project with latest
Rspec, I’m getting some strange time reporting (using --drb and spork):
Finished in 731.67 seconds
10 examples, 0 failures
But it actually run “time rake” in less than 2s. “time rspec” runs in
about 0.2s.
The finished time is always increasing. How do I reset the time on each
run with Spork?
Yes, I know it is more likely to be a Spork-specific issue, but maybe
there are other Rspec users here using Spork that have already some
solution to this.
Cheers,
Rodrigo.
dracko
December 9, 2011, 6:52pm
2
Em 09-12-2011 15:14, Rodrigo Rosenfeld R. escreveu:
While running some specs of a new fresh Rails 3.1 project with latest
Rspec, I’m getting some strange time reporting (using --drb and spork):
Finished in 731.67 seconds
10 examples, 0 failures
But it actually run “time rake” in less than 2s. “time rspec” runs in
about 0.2s.
Yeah, but “time rspec” doesn’t run any specs at all “time rspec spec”
finishes in about 0.4s. Sorry…
dracko
December 9, 2011, 7:21pm
3
On Dec 9, 2011, at 11:15 AM, Rodrigo Rosenfeld R.
[email protected] wrote:
Em 09-12-2011 15:14, Rodrigo Rosenfeld R. escreveu:
While running some specs of a new fresh Rails 3.1 project with latest Rspec,
I’m getting some strange time reporting (using --drb and spork):
Finished in 731.67 seconds
10 examples, 0 failures
But it actually run “time rake” in less than 2s. “time rspec” runs in about
0.2s.
Yeah, but “time rspec” doesn’t run any specs at all “time rspec spec”
finishes in about 0.4s. Sorry…
“time rspec” actually does run specs as of 2.7
dracko
December 9, 2011, 9:11pm
4
Em 09-12-2011 16:31, Rodrigo Rosenfeld R. escreveu:
10 examples, 0 failures
No examples found.
Finished in 5863.55 seconds
0 examples, 0 failures
Ignore the strange time since this is some issue with Spork that I
still don’t know how to fix…
Actually, it runs the specs unless --drb is specified in .rspec.
dracko
December 9, 2011, 10:19pm
5
On Fri, Dec 9, 2011 at 12:31 PM, Rodrigo Rosenfeld R.
[email protected] wrote:
Finished in 731.67 seconds
I’m using 2.7.1
I mis-spoke - it’s 2.8 (which is out as an rc: 2.8.0.rc1).
dracko
December 15, 2011, 4:37pm
6
There is a temporary solution here:
opened 10:54AM - 17 Oct 11 UTC
closed 01:55PM - 03 Jan 12 UTC
Hi,
With the new release of RSpec 2.7 the total time calculation has been modif… ied:
`Provide more accurate run time by registering start time before code is loaded (David Chelimsky)`
https://www.relishapp.com/rspec/rspec-core/docs/changelog
Check the Finished in **\* seconds in the following code. It is calculated from the time guard was started. It doesn't reflect how much the actual test took to run.
```
$ guard
Guard is now watching at '/Users/Nerian/Projects/davinci'
Starting Spork for RSpec
Using RSpec
Preloading Rails environment
Loading Spork.prefork block...
Spork is ready and listening on 8989!
Spork server for RSpec successfully started
Guard::RSpec is running, with RSpec 2!
Running all specs
Running tests with args ["--color", "--format", "progress", "--format", "Guard::RSpec::Formatter::NotificationRSpec", "--out", "/dev/null", "--require", "/Users/Nerian/.rvm/gems/ruby-1.9.3-rc1@davinci/gems/guard-rspec-0.5.0/lib/guard/rspec/formatters/notification_rspec.rb", "spec"]...
.................
Finished in 7.39 seconds
17 examples, 0 failures
Done.
Running all specs
Running tests with args ["--color", "--format", "progress", "--format", "Guard::RSpec::Formatter::NotificationRSpec", "--out", "/dev/null", "--require", "/Users/Nerian/.rvm/gems/ruby-1.9.3-rc1@davinci/gems/guard-rspec-0.5.0/lib/guard/rspec/formatters/notification_rspec.rb", "spec"]...
.................
Finished in 13.07 seconds
17 examples, 0 failures
Done.
Running all specs
Running tests with args ["--color", "--format", "progress", "--format", "Guard::RSpec::Formatter::NotificationRSpec", "--out", "/dev/null", "--require", "/Users/Nerian/.rvm/gems/ruby-1.9.3-rc1@davinci/gems/guard-rspec-0.5.0/lib/guard/rspec/formatters/notification_rspec.rb", "spec"]...
.................
Finished in 18.53 seconds
17 examples, 0 failures
Done.
Running all specs
Running tests with args ["--color", "--format", "progress", "--format", "Guard::RSpec::Formatter::NotificationRSpec", "--out", "/dev/null", "--require", "/Users/Nerian/.rvm/gems/ruby-1.9.3-rc1@davinci/gems/guard-rspec-0.5.0/lib/guard/rspec/formatters/notification_rspec.rb", "spec"]...
.................
Finished in 23.64 seconds
17 examples, 0 failures
Done.
```
dracko
December 9, 2011, 7:58pm
7
Em 09-12-2011 15:43, David C. escreveu:
“time rspec” actually does run specs as of 2.7
I’m using 2.7.1 here and the result of runnin rspec without specifying
the spec folder is:
No examples found.
Finished in 5863.55 seconds
0 examples, 0 failures
Ignore the strange time since this is some issue with Spork that I still
don’t know how to fix…