2011-07-28 7 views
2

JRubyを初めて使用しており、テストスイートを正しく実行しようとしています。私はminitestを使用しており、最小限のように見えますが、ObjectSpaceを有効にする必要があります。次のスタックトレースにつながるObjectSpaceのためJRuby + minitestが失敗する

bundle exec jruby -X+O -S rake 
jruby -X+O -S bundle exec rake 
JRUBY_OPTS="-X+O" bundle exec rake 
export JRUBY_OPTS="-X+O" && bundle exec rake 

およびそれらのすべて:私は、次の各コマンドを試してみた

RuntimeError: ObjectSpace is disabled; each_object will only work with Class, pass -X+O to enable 
each_object at org/jruby/RubyObjectSpace.java:167 
    each at org/jruby/RubyEnumerator.java:189 
    to_a at org/jruby/RubyEnumerable.java:375 
     AWS at /Users/kshipley/.rvm/gems/[email protected]/bundler/gems/papi-38fc7d34a33d/lib/papi/aws.rb:1476 
    Papi at /Users/kshipley/.rvm/gems/[email protected]/bundler/gems/papi-38fc7d34a33d/lib/papi/aws.rb:6 
    (root) at /Users/kshipley/.rvm/gems/[email protected]/bundler/gems/papi-38fc7d34a33d/lib/papi/aws.rb:5 
    require at org/jruby/RubyKernel.java:1038 
    (root) at /Users/kshipley/.rvm/gems/[email protected]/bundler/gems/papi-38fc7d34a33d/lib/papi/aws.rb:157 
    require at org/jruby/RubyKernel.java:1038 
    require at /Users/kshipley/.rvm/gems/[email protected]/bundler/gems/papi-38fc7d34a33d/lib/papi.rb:68 
    each at org/jruby/RubyArray.java:1602 
    require at /Users/kshipley/.rvm/gems/[email protected]/gems/bundler-1.0.15/lib/bundler/runtime.rb:66 
    each at org/jruby/RubyArray.java:1602 
    require at /Users/kshipley/.rvm/gems/[email protected]/gems/bundler-1.0.15/lib/bundler/runtime.rb:55 
    require at /Users/kshipley/.rvm/gems/[email protected]/gems/bundler-1.0.15/lib/bundler.rb:120 
    (root) at /Users/kshipley/work/src/split/config/environment.rb:5 
    require at org/jruby/RubyKernel.java:1038 
    (root) at /Users/kshipley/work/src/split/config/environment.rb:3 
    require at org/jruby/RubyKernel.java:1038 
    (root) at /Users/kshipley/work/src/split/test/test_helper.rb:1 
    load at org/jruby/RubyKernel.java:1063 
__file__ at /Users/kshipley/.rvm/gems/[email protected]/gems/rake-0.8.7/lib/rake/rake_test_loader.rb:5 
    each at org/jruby/RubyArray.java:1602 
    (root) at /Users/kshipley/.rvm/gems/[email protected]/gems/rake-0.8.7/lib/rake/rake_test_loader.rb:5 
rake aborted! 

実行しているときに適切なコマンドは、オブジェクト・スペースを再度有効にするために何であるか任意のアイデアレーキ?

bundle exec jruby -X+O test/functional/my_test.rb 
bundle exec jruby -X+O -S irb 

のようなコマンドを実行しているので、何らかの形でレーキに関連しているようです。

+0

'bundle exec jruby -X + O -S rake'についてはどうですか? –

+0

申し訳ありませんが、あなたのコメントに並行して編集しました。つまり、実際に実行していたコマンドです。 – Kyle

答えて

4

rakeタスクはサブプロセスを起動しますか?その場合、JRubyは現在のJVMプロセスを再利用している可能性があります。 JRUBY_OPTS='-X+O -J-Djruby.launch.inproc=false'をエクスポートしてください。

+0

これは私の問題を解決していますが、私のテスト実行時間が 本当\t 0m14.867s ユーザー\t 0m6.484s sysのREE下\t 0m1.269s から 本当\t 0m56.332s ユーザー\t 1m11に行ってきました。 491s sys \t 0m5.107s jruby-1.6.2。チューニングの提案はありますか?または、現時点でjrubyを実行する必要のあるコードを特定することを検討する必要がありますか? – Kyle

関連する問題