Failed running the puppet tests: bundle exec rake spec

365 views
Skip to first unread message

David Portabella

unread,
Apr 15, 2014, 9:35:29 AM4/15/14
to puppet...@googlegroups.com
Hi,

I need to build and run the specs on puppet, before I can send a pull request:

here it explains how to set up a machine with the dependencies for building puppet:

I've used a standard vagrant box with Ubuntu, so that it can be reproduced easily by anyone.
(and because it was difficult to install all this in my OSX machine)

However, I didn't manage to run all the tests (even without any modification to the puppet source code).

What can be the problem?
Do you have a step by step example for building puppet and running the tests?


$ vagrant up
$ vagrant ssh
$ sudo apt-get update
$ sudo apt-get install ruby-rvm
$ sudo gem install bundler
$ cd puppet
$ bundle install --path .bundle/gems/

$ script log.txt
Script started on Tue 15 Apr 2014 09:08:12 AM UTC

$ bundle exec rake spec

rspec spec
/opt/vagrant_ruby/lib/ruby/1.8/rdoc/dot/dot.rb:28: warning: already initialized constant NODE_OPTS
/opt/vagrant_ruby/lib/ruby/1.8/rdoc/dot/dot.rb:46: warning: already initialized constant EDGE_OPTS
/opt/vagrant_ruby/lib/ruby/1.8/rdoc/dot/dot.rb:76: warning: already initialized constant GRAPH_OPTS
Run options: exclude {:benchmark=>true, :broken=>true}
...............................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................**....................................................................................................................................**.......**.......**........................................................................................................................................................................*..*..........................................................................................................*...............................................................................FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF...........................................................................................................................................................................................................................................................................................................................................................................................................................................................*............................................F................................................................................Could not change to user puppet: Invalid user: puppet
FCould not change to user puppet: Invalid user: puppet
FCould not change to user puppet: Invalid user: puppet
FCould not change to user puppet: Invalid user: puppet
F.Could not change to user puppet: Invalid user: puppet
FCould not change to user puppet: Invalid user: puppet
FCould not change to user puppet: Invalid user: puppet
FCould not change to user puppet: Invalid user: puppet
F..............................................*................................................................................................................................................................................................................................................................................................................................................................................***...........................***..........................................................................*.................................................................................................................................****...................................................................................................................................................................................................*...............................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................**...................*........................................................................................................................

...............................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................Could not retrieve fact='uptime_seconds', resolution='<anonymous>': Failed while executing '/bin/cat /proc/uptime 2>/dev/null': Cannot allocate memory - /bin/cat /proc/uptime 2>/dev/null
Could not retrieve fact='kernelversion', resolution='<anonymous>': private method `split' called for nil:NilClass
Could not retrieve fact='kernelmajversion', resolution='<anonymous>': private method `split' called for nil:NilClass
Could not retrieve fact='uptime_seconds', resolution='<anonymous>': Failed while executing '/bin/cat /proc/uptime 2>/dev/null': Cannot allocate memory - /bin/cat /proc/uptime 2>/dev/null
Could not retrieve fact='hostname', resolution='<anonymous>': Failed while executing '/bin/hostname': Cannot allocate memory - /bin/hostname
Could not retrieve fact='hostname', resolution='<anonymous>': Failed while executing '/bin/hostname': Cannot allocate memory - /bin/hostname
Could not retrieve fact='uptime_seconds', resolution='<anonymous>': Failed while executing '/bin/cat /proc/uptime 2>/dev/null': Cannot allocate memory - /bin/cat /proc/uptime 2>/dev/null
Could not retrieve fact='kernelversion', resolution='<anonymous>': private method `split' called for nil:NilClass
Could not retrieve fact='hostname', resolution='<anonymous>': Failed while executing '/bin/hostname': Cannot allocate memory - /bin/hostname
Could not retrieve fact='uptime_seconds', resolution='<anonymous>': Failed while executing '/bin/cat /proc/uptime 2>/dev/null': Cannot allocate memory - /bin/cat /proc/uptime 2>/dev/null
Could not retrieve fact='hostname', resolution='<anonymous>': Failed while executing '/bin/hostname': Cannot allocate memory - /bin/hostname
Could not retrieve fact='uptime_seconds', resolution='<anonymous>': Failed while executing '/bin/cat /proc/uptime 2>/dev/null': Cannot allocate memory - /bin/cat /proc/uptime 2>/dev/null
Could not retrieve fact='kernelversion', resolution='<anonymous>': private method `split' called for nil:NilClass
Could not retrieve fact='kernelmajversion', resolution='<anonymous>': private method `split' called for nil:NilClass
Could not retrieve fact='uptime_seconds', resolution='<anonymous>': Failed while executing '/bin/cat /proc/uptime 2>/dev/null': Cannot allocate memory - /bin/cat /proc/uptime 2>/dev/null
Could not retrieve fact='hostname', resolution='<anonymous>': Failed while executing '/bin/hostname': Cannot allocate memory - /bin/hostname
Could not retrieve fact='hostname', resolution='<anonymous>': Failed while executing '/bin/hostname': Cannot allocate memory - /bin/hostname
Could not retrieve fact='uptime_seconds', resolution='<anonymous>': Failed while executing '/bin/cat /proc/uptime 2>/dev/null': Cannot allocate memory - /bin/cat /proc/uptime 2>/dev/null
Could not retrieve fact='kernelversion', resolution='<anonymous>': private method `split' called for nil:NilClass
Could not retrieve fact='hostname', resolution='<anonymous>': Failed while executing '/bin/hostname': Cannot allocate memory - /bin/hostname
Could not retrieve fact='uptime_seconds', resolution='<anonymous>': Failed while executing '/bin/cat /proc/uptime 2>/dev/null': Cannot allocate memory - /bin/cat /proc/uptime 2>/dev/null
Could not retrieve fact='hostname', resolution='<anonymous>': Failed while executing '/bin/hostname': Cannot allocate memory - /bin/hostname
.....................................................*......................................................................................................................................................*..............................................................................................

.

...................................................................................*............................******.........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................*............................
rake aborted!
Command failed with status (): [rspec spec...]
/vagrant/puppet/Rakefile:67
Tasks: TOP => spec
(See full trace by running task with --trace)

$ exit

Script done on Tue 15 Apr 2014 01:22:51 PM UTC


---
bundle exec rake spec fails after 4 hours with this message.

What can be the problem?
Do you have a step by step example for building puppet and running the tests?

Felix Frank

unread,
Apr 15, 2014, 11:05:22 AM4/15/14
to puppet...@googlegroups.com
Hi,

have you noticed the 'cannot allocate memory' errors in the output you
provided?

Is your VM sized too small to run the full test suite, perhaps?

Try doubling the RAM (at least), see if that does anything.

HTH,
Felix

David Portabella

unread,
Apr 15, 2014, 12:20:35 PM4/15/14
to puppet...@googlegroups.com
ok,thanks.

I've added more memory to the virtual machine,
and now it works.
19753 examples, 0 failures, 86 pending

(although I still get one "Cannot allocate memory" error)

I've created a gist, in case anyone is interested


Regards,
David

Kylo Ginsberg

unread,
Apr 18, 2014, 12:48:36 AM4/18/14
to puppet...@googlegroups.com
On Tue, Apr 15, 2014 at 9:20 AM, David Portabella <david.po...@gmail.com> wrote:
I've added more memory to the virtual machine,
and now it works.
19753 examples, 0 failures, 86 pending

(although I still get one "Cannot allocate memory" error)


If you run 'bundle exec rake parallel:spec[1]' instead of 'bundle exec rake spec' it should use less memory. That number in square brackets is the number of processes to run in parallel, so if you've given your vm multiple processors, bump that number and specs should run faster as well.

Kylo
--
Kylo Ginsberg

Join us at PuppetConf 2014September 22-24 in San Francisco - http://puppetconf.com 
Register by May 30th to take advantage of the Early Adopter discount save $349!

Reply all
Reply to author
Forward
0 new messages