rails_event_store icon indicating copy to clipboard operation
rails_event_store copied to clipboard

Test on TruffleRuby

Open mostlyobvious opened this issue 6 years ago • 16 comments

Add TruffleRuby into .travis.yml matrix.

See:

  • https://docs.travis-ci.com/user/languages/ruby/
  • https://github.com/rvm/rvm/issues/4297#issuecomment-397908042

mostlyobvious avatar Aug 07 '18 09:08 mostlyobvious

For now it's probably not yet possible to successfully run it, because of https://github.com/oracle/truffleruby/issues/1400 . But someone can try :)

swistak35 avatar Aug 07 '18 10:08 swistak35

I believe you can set expected fail on Travis in regard to some matrix configurations or don't test c-ext matrix branches at all.

mostlyobvious avatar Aug 07 '18 10:08 mostlyobvious

https://docs.travis-ci.com/user/customizing-the-build/#rows-that-are-allowed-to-fail it is

mostlyobvious avatar Aug 07 '18 10:08 mostlyobvious

https://www.reddit.com/r/ruby/comments/9clma3/truffle_ruby_100rc6_supports_pg_and_mysql_drivers/

paneq avatar Sep 03 '18 13:09 paneq

https://github.com/oracle/truffleruby/issues/62

mostlyobvious avatar Sep 21 '18 18:09 mostlyobvious

Let's wait till it's travis-rim-supported out of the box.

mostlyobvious avatar Sep 23 '18 14:09 mostlyobvious

https://github.com/oracle/truffleruby/issues/62#issuecomment-407322864

mostlyobvious avatar Nov 29 '18 12:11 mostlyobvious

Current PR: https://github.com/RailsEventStore/rails_event_store/pull/505

mostlyobvious avatar Nov 29 '18 12:11 mostlyobvious

Aside to running tests on CI, I've scoped down the test run to ruby_event_store and it fails on:

rspec ./spec/batch_enumerator_spec.rb:22 # RubyEventStore::BatchEnumerator
rspec ./spec/batch_enumerator_spec.rb:50 # RubyEventStore::BatchEnumerator should receive call(kind of Integer, kind of Integer) 1 time
rspec ./spec/batch_enumerator_spec.rb:30 # RubyEventStore::BatchEnumerator should yield successive args([1, 2, 3, 4, 5, 6, 7, 8,

where the code involved is:

     Failure/Error: (0...total_limit).step(batch_size) do |batch_offset|

     ArgumentError:
       Infinite or NaN

mostlyobvious avatar Dec 04 '18 00:12 mostlyobvious

irb(main):003:0> (0...Float::INFINITY).step(1).next
ArgumentError: Infinite or NaN

mostlyobvious avatar Dec 04 '18 00:12 mostlyobvious

To be revisited after oracle/truffleruby#1503 and #422 (comment) are solved.

mostlyobvious avatar Dec 18 '18 20:12 mostlyobvious

Let's check this in what's left from 2020

mostlyobvious avatar Dec 07 '20 21:12 mostlyobvious

@pawelpacana any update? :)

LifeIsStrange avatar Feb 15 '21 04:02 LifeIsStrange

@LifeIsStrange one minor issue in ruby_event_store gem (in test code) that would require reporting in TruffleRuby tracker: an instance of what is Integer on MRI is a Float under Truffleruby.


Failures:

  1) RubyEventStore::BatchEnumerator is expected to receive call(kind of Integer, kind of Integer) 1 time
     Failure/Error: result      = reader.call(batch_offset, batch_limit)
     
       #<Double :reader> received :call with unexpected arguments
         expected: (kind of Integer, kind of Integer)
              got: (0.0, 100)
     # ./lib/ruby_event_store/batch_enumerator.rb:16:in `block in each'
     # <internal:core> core/numeric.rb:131:in `step'
     # ./lib/ruby_event_store/batch_enumerator.rb:14:in `each'
     # <internal:core> core/enumerator.rb:103:in `each_with_block'
     # <internal:core> core/enumerator.rb:94:in `each'
     # <internal:core> core/enumerable.rb:287:in `to_a'
     # ./lib/ruby_event_store/batch_enumerator.rb:28:in `to_a'
     # ./spec/batch_enumerator_spec.rb:52:in `block (2 levels) in <module:RubyEventStore>'
     # <internal:core> core/kernel.rb:400:in `load'
     # <internal:core> core/kernel.rb:400:in `load'
     # <internal:core> core/kernel.rb:400:in `load'
     # <internal:core> core/kernel.rb:400:in `load'
     # /Users/pawelpacana/.rubies/truffleruby-21.0.0/lib/mri/bundler/cli/exec.rb:63:in `kernel_load'
     # /Users/pawelpacana/.rubies/truffleruby-21.0.0/lib/mri/bundler/cli/exec.rb:28:in `run'
     # /Users/pawelpacana/.rubies/truffleruby-21.0.0/lib/mri/bundler/cli.rb:476:in `exec'
     # /Users/pawelpacana/.rubies/truffleruby-21.0.0/lib/mri/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
     # /Users/pawelpacana/.rubies/truffleruby-21.0.0/lib/mri/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
     # /Users/pawelpacana/.rubies/truffleruby-21.0.0/lib/mri/bundler/vendor/thor/lib/thor.rb:399:in `dispatch'
     # /Users/pawelpacana/.rubies/truffleruby-21.0.0/lib/mri/bundler/cli.rb:30:in `dispatch'
     # /Users/pawelpacana/.rubies/truffleruby-21.0.0/lib/mri/bundler/vendor/thor/lib/thor/base.rb:476:in `start'
     # /Users/pawelpacana/.rubies/truffleruby-21.0.0/lib/mri/bundler/cli.rb:24:in `start'
     # /Users/pawelpacana/.rubies/truffleruby-21.0.0/lib/gems/gems/bundler-2.1.4/libexec/bundle:46:in `block in <top (required)>'
     # /Users/pawelpacana/.rubies/truffleruby-21.0.0/lib/mri/bundler/friendly_errors.rb:123:in `with_friendly_errors'
     # /Users/pawelpacana/.rubies/truffleruby-21.0.0/lib/gems/gems/bundler-2.1.4/libexec/bundle:34:in `<top (required)>'
     # <internal:core> core/kernel.rb:400:in `load'
     # <internal:core> core/kernel.rb:400:in `load'

Finished in 19.62 seconds (files took 2.45 seconds to load)
713 examples, 1 failure, 7 pending

Failed examples:

rspec ./spec/batch_enumerator_spec.rb:50 # RubyEventStore::BatchEnumerator is expected to receive call(kind of Integer, kind of Integer) 1 time

Do you think it is something you could help us with? The way I see it is:

  1. reducing the code to minial amount showing the disparity of Truffleruby with MRI
  2. reporting this similarly to https://github.com/oracle/truffleruby/issues/1503

mostlyobvious avatar Feb 15 '21 19:02 mostlyobvious

@pawelpacana hi, thanks for the update! Sorry I can't help with this task, I'm just a nerd interested in Truffleruby support for Rails and how it would affect performance, I don't even know the Ruby language yet ^^

LifeIsStrange avatar Feb 16 '21 17:02 LifeIsStrange

Just seeing this, I think it would be fine to basically file https://github.com/RailsEventStore/rails_event_store/issues/419#issuecomment-779402997 as a TruffleRuby issue, as long as it's relatively easy to reproduce. We don't necessarily need a minimal reproduction, although of course it's always helpful.

eregon avatar Feb 16 '21 18:02 eregon

Already testing.

mostlyobvious avatar Jan 31 '23 10:01 mostlyobvious