Rubinius support for specs and travis-ci #3053

Closed
wants to merge 27 commits into from

4 participants

@limhoff-r7

Get specs passing locally for rbx-2.2.5 (latest as of this time). Having issues on travis-ci because the build times out after 50 minutes. I don't have this issue when running specs locally: the build finishes in 275.81 seconds on my MacBook Pro running Mavericks. I'm not sure if the build time is related to hardware differences or OS difference on the travis-ci build servers. I'd appreciate developers using Linux and Windows to test this out locally to try to narrow down the performance issues.

If we can't figure out why travis-ci is slower, then I'll have to add rbx to the allowed failures part of the build matrix, but the changes in this PR are still useful for rbx compatibility for those users who are interested and because it fixes some thread leaks in the specs.

limhoff-r7 added some commits Nov 18, 2013
@limhoff-r7 limhoff-r7 Merge remote-tracking branch 'upstream/master' 12a1e8a
@limhoff-r7 limhoff-r7 Merge remote-tracking branch 'upstream/master' c7c7653
@limhoff-r7 limhoff-r7 Merge remote-tracking branch 'upstream/master' a6cdad1
@limhoff-r7 limhoff-r7 Merge remote-tracking branch 'upstream/master' 69b04b4
@limhoff-r7 limhoff-r7 Merge remote-tracking branch 'upstream/master' cd0d7be
@limhoff-r7 limhoff-r7 Merge remote-tracking branch 'upstream/master' f7f3cb9
@limhoff-r7 limhoff-r7 Merge remote-tracking branch 'upstream/master' 6f59b34
@limhoff-r7 limhoff-r7 And standard library gems for Rubinius b2aaf3d
@limhoff-r7 limhoff-r7 Remove Iconv usage
MSP-9228

Iconv was deprecated in Ruby 1.9.3 and is gone in 2.0, so it doesn't
work at all with Rubinius 2.2, so replace with String#encode.
b302427
@limhoff-r7 limhoff-r7 msfconsole booting under Rubinius
msfconsole boots and gets to a prompt, but prints warnings.
003f88b
@limhoff-r7 limhoff-r7 Fix load warnings before rinda 79e5978
@limhoff-r7 limhoff-r7 Fix rinda loading c8e4de2
@limhoff-r7 limhoff-r7 Fix irb command b77adac
@limhoff-r7 limhoff-r7 Add rubinius (rbx) to travis-ci builds fe69f6a
@limhoff-r7 limhoff-r7 Add msfcli_spec dependencies 31fbf31
@limhoff-r7 limhoff-r7 Add coverage libraries for simplecov 9410288
@limhoff-r7 limhoff-r7 Make Msf::Module::Loader::Base spec platform independent
Rubinius reports the module-path in line 1 instead of 0, so just check
if the module_path is in any line of the backtrace.
7a367f0
@limhoff-r7 limhoff-r7 Merge remote-tracking branch 'upstream/master' 528856d
@limhoff-r7 limhoff-r7 Merge remote-tracking branch 'upstream/master'
Conflicts:
	external/source/exploits/make.bat
	lib/msf/core/payload_generator.rb
	lib/rex/zip/jar.rb
	modules/encoders/x86/opt_sub.rb
	modules/exploits/multi/http/dexter_casinoloader_exec.rb
	msfvenom
	spec/lib/msf/core/payload_generator_spec.rb
898e807
@limhoff-r7 limhoff-r7 Fix merge error 89462d4
@limhoff-r7 limhoff-r7 Merge branch 'master' into feature/rubinius 3d196cb
@limhoff-r7 limhoff-r7 Rescue PrimiteFailure for Regexp.compile
On rubinius, Regexp.compile(<Integer>) raised PrimitiveFailure instead
of TypeError raised by MRI.
13972f8
@limhoff-r7 limhoff-r7 Loosen message match on KeyError
Rubinius's wording is slightly different.
5afc145
@limhoff-r7 limhoff-r7 Remove unreliable with_connection specs
should_receive(:with_connection) can report varying call counts
depending on the spec order and it's not possible to separate the
code-under-test calls from the test setup calls, so remove these
problematic specs completely since they're just causing random false
failures.
a11f072
@limhoff-r7 limhoff-r7 Remove remainder of specs using should_receive(:with_connection)
Too unreliable: unpredicatble failures.
be79e6b
@limhoff-r7 limhoff-r7 Detect and clean up Thread leaks
Threads spawned by Msf::Framework#initialize were not being cleaned up,
which could cause the tests to slow down, so explicitly kill to stop the
threads and then join them to ensure they aren't left as dead in the
Thread.list.  Added around(:each) to spec_helper.rb to monitor for
thread leaks in the future: if a thread is leaked, then the example that
leaked the thread will fail.
5bfa80e
@limhoff-r7

Verification Steps

  • Update rvm to get access to Rubinius 2.2.5: rvm get head
  • Install rbx-2.2.5: rvm install rbx-2.2.5
  • Create and use gemset: rvm use rbx@metasploit-framework --create
  • bundle exec rake spec
  • VERIFY no errors or failures in specs.
@limhoff-r7 limhoff-r7 Join killed threads to ensure clean up
MSP-9425

Call Thread#join after Thread#kill to ensure that the killed thread dies
completely and is removed from Thread.list.
23f49f5
@limhoff-r7

The ruby build is passing now, but I expect the rbx build to timeout. Can you check if the rbx build works locally for you @mbuck-r7? If it does, then I'll have to find a work-around for the timeout issue for rbx.

@limhoff-r7

Made it with 7 seconds to spare! The actual rspec run looks like it took only 32 minutes, so I'm inclined to see if I can use the travis_ci_bundle gem to speed up the pre-rspec time.

screen shot 2014-03-19 at 3 05 57 pm

@lsanchez-r7

NameError: uninitialized constant Rubinius::ToolSets
https://github.com/rubinius/rubinius-processor/issues/2

using Rubinius 2.2.6

@lsanchez-r7

Finished in 25 minutes 46 seconds
1689 examples, 0 failures, 23 pending

@lsanchez-r7

closing until we have time find the performance issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment