Project

General

Profile

Actions

Bug #16785

closed

ruby 2.8.0-dev 5c27681813 causes Rails CI failure

Added by yahonda (Yasuo Honda) about 4 years ago. Updated about 4 years ago.

Status:
Closed
Target version:
-
ruby -v:
ruby 2.8.0dev (2020-04-12T03:45:22Z master 5c27681813) [x86_64-darwin19]
[ruby-core:97877]

Description

Rails CI has been failing since https://buildkite.com/rails/rails/builds/68202#ee7fdd62-d66b-48a1-a55f-af28a2bff287 , according to git bisect it is triggered since ruby 2.8.0-dev 5c27681813

Steps to reproduce (I have not found how to reproduce without Rails framework)

git clone https://github.com/rails/rails
cd rails/actionpack
bundle install
PARALLEL_WORKERS=1 bin/test test/controller/base_test.rb  --seed 31701 -n "/^(?:UrlOptionsTest#(?:test_url_options_override)|ControllerInstanceTests#(?:test_performed\\?)|PerformActionTest#(?:test_action_missing_should_work))$/"

Expected result

It should pass as ruby 2.8.0-dev a01bda594996fdc247e183f107cada43e2c8e3b8 or prior versions.

Actual result:

 % PARALLEL_WORKERS=1 bin/test test/controller/base_test.rb  --seed 31701 -n "/^(?:UrlOptionsTest#(?:test_url_options_override)|ControllerInstanceTests#(?:test_performed\\?)|PerformActionTest#(?:test_action_missing_should_work))$/"
Run options: --seed 31701 -n "/^(?:UrlOptionsTest#(?:test_url_options_override)|ControllerInstanceTests#(?:test_performed\\?)|PerformActionTest#(?:test_action_missing_should_work))$/"

# Running:

.E

Error:
PerformActionTest#test_action_missing_should_work:
ActionController::MissingExactTemplate: ActionMissingController#["Response for arbitrary_action"] is missing a template for request formats: text/html
    /Users/yahonda/src/github.com/rails/rails/actionpack/lib/action_controller/metal/implicit_render.rb:45:in `default_render'
    /Users/yahonda/src/github.com/rails/rails/actionpack/lib/action_controller/metal/basic_implicit_render.rb:6:in `block in send_action'
    /Users/yahonda/src/github.com/rails/rails/actionpack/lib/action_controller/metal/basic_implicit_render.rb:6:in `tap'
    /Users/yahonda/src/github.com/rails/rails/actionpack/lib/action_controller/metal/basic_implicit_render.rb:6:in `send_action'
    /Users/yahonda/src/github.com/rails/rails/actionpack/lib/abstract_controller/base.rb:195:in `process_action'
    /Users/yahonda/src/github.com/rails/rails/actionpack/lib/action_controller/metal/rendering.rb:30:in `process_action'
    /Users/yahonda/src/github.com/rails/rails/actionpack/lib/abstract_controller/callbacks.rb:42:in `block in process_action'
    /Users/yahonda/src/github.com/rails/rails/activesupport/lib/active_support/callbacks.rb:98:in `run_callbacks'
    /Users/yahonda/src/github.com/rails/rails/actionpack/lib/abstract_controller/callbacks.rb:41:in `process_action'
    /Users/yahonda/src/github.com/rails/rails/actionpack/lib/action_controller/metal/rescue.rb:22:in `process_action'
    /Users/yahonda/src/github.com/rails/rails/actionpack/lib/action_controller/metal/instrumentation.rb:34:in `block in process_action'
    /Users/yahonda/src/github.com/rails/rails/activesupport/lib/active_support/notifications.rb:203:in `block in instrument'
    /Users/yahonda/src/github.com/rails/rails/activesupport/lib/active_support/notifications/instrumenter.rb:24:in `instrument'
    /Users/yahonda/src/github.com/rails/rails/activesupport/lib/active_support/notifications.rb:203:in `instrument'
    /Users/yahonda/src/github.com/rails/rails/actionpack/lib/action_controller/metal/instrumentation.rb:33:in `process_action'
    /Users/yahonda/src/github.com/rails/rails/actionpack/lib/action_controller/metal/params_wrapper.rb:245:in `process_action'
    /Users/yahonda/src/github.com/rails/rails/actionpack/lib/abstract_controller/base.rb:136:in `process'
    /Users/yahonda/src/github.com/rails/rails/actionview/lib/action_view/rendering.rb:39:in `process'
    /Users/yahonda/src/github.com/rails/rails/actionpack/lib/action_controller/metal.rb:190:in `dispatch'
    /Users/yahonda/src/github.com/rails/rails/actionpack/lib/action_controller/test_case.rb:517:in `process'
    /Users/yahonda/src/github.com/rails/rails/actionpack/lib/action_controller/test_case.rb:395:in `get'
    /Users/yahonda/src/github.com/rails/rails/actionpack/test/controller/base_test.rb:173:in `test_action_missing_should_work'


bin/test Users/yahonda/src/github.com/rails/rails/actionpack/test/controller/base_test.rb:171

.

Finished in 0.128453s, 23.3548 runs/s, 38.9247 assertions/s.
3 runs, 5 assertions, 0 failures, 1 errors, 0 skips
%

Updated by k0kubun (Takashi Kokubun) about 4 years ago

  • Status changed from Open to Assigned
  • Assignee set to k0kubun (Takashi Kokubun)

5c27681813

Thank you for your report. Let me take a look at this.

Actions #2

Updated by k0kubun (Takashi Kokubun) about 4 years ago

  • Status changed from Assigned to Closed

Applied in changeset git|8355a998839f17ff214a89062821a0a4287f6a54.


Invalidate fastpath when calling attr_writer by super

We started to use fastpath on invokesuper when a method is not refinements
since 5c27681813, but we shouldn't have used fastpath for attr_writer either.

cc->aux_.attr_index is for an actual receiver class, while we store
its superclass in cc->klass and therefore there's no way to properly
invalidate attr_writer's inline cache when it's called by super.

[Bug #16785]

I suspect the same bug also exists in attr_reader. I'll address that in
another commit.

Updated by k0kubun (Takashi Kokubun) about 4 years ago

Thanks to the easy way to reproduce the issue, I could fix the failure in 8355a99883 at least in my environment. Also I fixed a similar problem in 79f3403be0.

Could you check if 79f3403be0 fixes the problem?

Updated by yahonda (Yasuo Honda) about 4 years ago

I have confirmed 79f3403b addresses the issue.

% ruby -v
ruby 2.8.0dev (2020-04-15T06:49:29Z master 79f3403be0) [x86_64-darwin19]
% PARALLEL_WORKERS=1 bin/test test/controller/base_test.rb  --seed 31701 -n "/^(?:UrlOptionsTest#(?:test_url_options_override)|ControllerInstanceTests#(?:test_performed\\?)|PerformActionTest#(?:test_action_missing_should_work))$/"
Run options: --seed 31701 -n "/^(?:UrlOptionsTest#(?:test_url_options_override)|ControllerInstanceTests#(?:test_performed\\?)|PerformActionTest#(?:test_action_missing_should_work))$/"

# Running:

...

Finished in 0.126021s, 23.8056 runs/s, 47.6111 assertions/s.
3 runs, 6 assertions, 0 failures, 0 errors, 0 skips
%

Thank you for the fix.

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0