Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test in Ruby 2.7 #7386

Merged
merged 3 commits into from Apr 24, 2020
Merged

Test in Ruby 2.7 #7386

merged 3 commits into from Apr 24, 2020

Conversation

qnighy
Copy link
Contributor

@qnighy qnighy commented Apr 16, 2020

Split from #7027. This PR focuses on testing on Ruby 2.7, while #7027 focuses on building artifacts for Ruby 2.7.

I guess someone needs to run kokoro/linux/dockerfile/push_testing_images.sh before running CI, because I modified a dockerfile in kokoro/linux/dockerfile/test?

@qnighy
Copy link
Contributor Author

qnighy commented Apr 17, 2020

cc: @haberman

@TeBoring
Copy link
Contributor

Could you sync?
I changed some docker file in #7396

@qnighy
Copy link
Contributor Author

qnighy commented Apr 21, 2020

@TeBoring

Could you sync?
I changed some docker file in #7396

Sure, rebased it to the latest master!

@TeBoring
Copy link
Contributor

/usr/local/rvm/rubies/ruby-2.7.0/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:72: [BUG] Segmentation fault at 0x0000000102794458

@qnighy
Copy link
Contributor Author

qnighy commented Apr 22, 2020

The segfault occurs before even loading protobuf_c. I guess this is Ruby's problem...?

@qnighy
Copy link
Contributor Author

qnighy commented Apr 22, 2020

Reported: https://bugs.ruby-lang.org/issues/16807

@haberman
Copy link
Member

@qnighy thank you! I was not looking forward to debugging that one...

@haberman
Copy link
Member

haberman commented Apr 22, 2020

Is there a way we can disable the test(s) that are triggering this Ruby bug, until the bug is fixed upstream?

I am planning to start a release very soon and was hoping Ruby 2.7 gems would be part of it.

@TeBoring
Copy link
Contributor

TeBoring commented Apr 22, 2020 via email

@haberman
Copy link
Member

@TeBoring The issue was only reported upstream yesterday by @qnighy . I don't think the Ruby developers had heard about the bug before then. So I expect there is no released fix yet.

@TeBoring
Copy link
Contributor

TeBoring commented Apr 22, 2020 via email

@haberman
Copy link
Member

It appears that it's the code loading itself that is triggering the bug, not a test. So maybe we need to disable GC.stress for Ruby 2.7?

@qnighy
Copy link
Contributor Author

qnighy commented Apr 23, 2020

It appears that it's the code loading itself that is triggering the bug, not a test. So maybe we need to disable GC.stress for Ruby 2.7?

I added the following commit (d95f630). How about this?

diff --git a/ruby/tests/gc_test.rb b/ruby/tests/gc_test.rb
index 55b96289e..6ef4e2e30 100755
--- a/ruby/tests/gc_test.rb
+++ b/ruby/tests/gc_test.rb
@@ -4,7 +4,9 @@
 $LOAD_PATH.unshift(File.expand_path(File.dirname(__FILE__)))

 old_gc = GC.stress
-GC.stress = 0x01 | 0x04
+# Ruby 2.7.0 - 2.7.1 has a GC bug in its parser, so turn off stress for now
+# See https://bugs.ruby-lang.org/issues/16807
+GC.stress = 0x01 | 0x04 unless RUBY_VERSION.match?(/^2\.7\./)
 require 'generated_code_pb'
 require 'generated_code_proto2_pb'
 GC.stress = old_gc

@haberman
Copy link
Member

Looks like we have one failure now:

Failure: test_acts_like_an_array(RepeatedFieldTest):
  does not respond to intersection.
  <false> is not true.
/tmp/protobuf/protobuf/ruby/compatibility_tests/v3.0.0/tests/repeated_field_test.rb:24:in `block in test_acts_like_an_array'
     21:       :nitems, :iter_for_reverse_each, :indexes, :append, :prepend]
     22:     arr_methods -= [:union, :difference, :filter!]
     23:     arr_methods.each do |method_name|
  => 24:       assert m.repeated_string.respond_to?(method_name) == true, "does not respond to #{method_name}"
     25:     end
     26:   end
     27:
/tmp/protobuf/protobuf/ruby/compatibility_tests/v3.0.0/tests/repeated_field_test.rb:23:in `each'
/tmp/protobuf/protobuf/ruby/compatibility_tests/v3.0.0/tests/repeated_field_test.rb:23:in `test_acts_like_an_array'

@qnighy
Copy link
Contributor Author

qnighy commented Apr 24, 2020

Fixed in 973df41

@haberman haberman merged commit f494cb2 into protocolbuffers:master Apr 24, 2020
@qnighy qnighy deleted the test-in-ruby-2.7 branch April 25, 2020 04:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants