Project

General

Profile

Bug #10123

Api::V2::ExternalUsergroupsControllerTest fails with "Render and/or redirect were called multiple times"

Added by Dominic Cleal over 6 years ago. Updated about 3 years ago.

Status:
Closed
Priority:
Urgent
Category:
Tests
Target version:
Difficulty:
Triaged:
Bugzilla link:
Fixed in Releases:
Found in Releases:

Description

http://ci.theforeman.org/job/test_develop/1239/

The following tests are failing since #9878 was merged:

  • Api::V2::ExternalUsergroupsControllerTest.test_0003_create external user group
  • Api::V2::ExternalUsergroupsControllerTest.test_0005_update a external user group
  • Api::V2::ExternalUsergroupsControllerTest.test_0006_destroy external user group
Render and/or redirect were called multiple times in this action. Please note that you may only call render OR redirect, and at most once per action. Also note that neither redirect nor render terminate execution of the action, so if you want to exit an action after redirecting, you need to do something like "redirect_to(...) and return". (AbstractController::DoubleRenderError)
/usr/local/rvm/gems/ruby-1.9.3-p392@test_develop-0/gems/actionpack-3.2.21/lib/action_controller/metal/rendering.rb:15:in `render'
/usr/local/rvm/gems/ruby-1.9.3-p392@test_develop-0/gems/actionpack-3.2.21/lib/action_controller/metal/instrumentation.rb:40:in `block (2 levels) in render'
/usr/local/rvm/gems/ruby-1.9.3-p392@test_develop-0/gems/activesupport-3.2.21/lib/active_support/core_ext/benchmark.rb:5:in `block in ms'
/usr/local/rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/benchmark.rb:295:in `realtime'
/usr/local/rvm/gems/ruby-1.9.3-p392@test_develop-0/gems/activesupport-3.2.21/lib/active_support/core_ext/benchmark.rb:5:in `ms'
/usr/local/rvm/gems/ruby-1.9.3-p392@test_develop-0/gems/actionpack-3.2.21/lib/action_controller/metal/instrumentation.rb:40:in `block in render'
/usr/local/rvm/gems/ruby-1.9.3-p392@test_develop-0/gems/actionpack-3.2.21/lib/action_controller/metal/instrumentation.rb:83:in `cleanup_view_runtime'
/usr/local/rvm/gems/ruby-1.9.3-p392@test_develop-0/gems/activerecord-3.2.21/lib/active_record/railties/controller_runtime.rb:24:in `cleanup_view_runtime'
/usr/local/rvm/gems/ruby-1.9.3-p392@test_develop-0/gems/actionpack-3.2.21/lib/action_controller/metal/instrumentation.rb:39:in `render'
/var/lib/workspace/workspace/test_develop/database/postgresql/ruby/1.9.3/app/controllers/api/v2/base_controller.rb:143:in `render_error'
/var/lib/workspace/workspace/test_develop/database/postgresql/ruby/1.9.3/app/controllers/api/base_controller.rb:21:in `block in <class:BaseController>'
/usr/local/rvm/gems/ruby-1.9.3-p392@test_develop-0/gems/activesupport-3.2.21/lib/active_support/rescuable.rb:80:in `call'
/usr/local/rvm/gems/ruby-1.9.3-p392@test_develop-0/gems/activesupport-3.2.21/lib/active_support/rescuable.rb:80:in `rescue_with_handler'
/usr/local/rvm/gems/ruby-1.9.3-p392@test_develop-0/gems/actionpack-3.2.21/lib/action_controller/metal/rescue.rb:15:in `rescue_with_handler'
/usr/local/rvm/gems/ruby-1.9.3-p392@test_develop-0/gems/actionpack-3.2.21/lib/action_controller/metal/rescue.rb:32:in `rescue in process_action'
/usr/local/rvm/gems/ruby-1.9.3-p392@test_develop-0/gems/actionpack-3.2.21/lib/action_controller/metal/rescue.rb:29:in `process_action'
/usr/local/rvm/gems/ruby-1.9.3-p392@test_develop-0/gems/actionpack-3.2.21/lib/action_controller/metal/instrumentation.rb:30:in `block in process_action'
/usr/local/rvm/gems/ruby-1.9.3-p392@test_develop-0/gems/activesupport-3.2.21/lib/active_support/notifications.rb:123:in `block in instrument'
/usr/local/rvm/gems/ruby-1.9.3-p392@test_develop-0/gems/activesupport-3.2.21/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
/usr/local/rvm/gems/ruby-1.9.3-p392@test_develop-0/gems/activesupport-3.2.21/lib/active_support/notifications.rb:123:in `instrument'
/usr/local/rvm/gems/ruby-1.9.3-p392@test_develop-0/gems/actionpack-3.2.21/lib/action_controller/metal/instrumentation.rb:29:in `process_action'
/usr/local/rvm/gems/ruby-1.9.3-p392@test_develop-0/gems/actionpack-3.2.21/lib/action_controller/metal/params_wrapper.rb:207:in `process_action'
/usr/local/rvm/gems/ruby-1.9.3-p392@test_develop-0/gems/activerecord-3.2.21/lib/active_record/railties/controller_runtime.rb:18:in `process_action'
/usr/local/rvm/gems/ruby-1.9.3-p392@test_develop-0/gems/actionpack-3.2.21/lib/abstract_controller/base.rb:121:in `process'
/usr/local/rvm/gems/ruby-1.9.3-p392@test_develop-0/gems/actionpack-3.2.21/lib/abstract_controller/rendering.rb:45:in `process'
/usr/local/rvm/gems/ruby-1.9.3-p392@test_develop-0/gems/actionpack-3.2.21/lib/action_controller/metal/testing.rb:17:in `process_with_new_base_test'
/usr/local/rvm/gems/ruby-1.9.3-p392@test_develop-0/gems/actionpack-3.2.21/lib/action_controller/test_case.rb:490:in `process'
/usr/local/rvm/gems/ruby-1.9.3-p392@test_develop-0/gems/apipie-rails-0.2.6/lib/apipie/extractor/recorder.rb:118:in `process_with_api_recording'
/usr/local/rvm/gems/ruby-1.9.3-p392@test_develop-0/gems/actionpack-3.2.21/lib/action_controller/test_case.rb:54:in `process'
/usr/local/rvm/gems/ruby-1.9.3-p392@test_develop-0/gems/actionpack-3.2.21/lib/action_controller/test_case.rb:412:in `post'
/var/lib/workspace/workspace/test_develop/database/postgresql/ruby/1.9.3/test/functional/api/v2/external_usergroups_controller_test.rb:28:in `block (2 levels) in <class:ExternalUsergroupsControllerTest>'
/usr/local/rvm/gems/ruby-1.9.3-p392@test_develop-0/gems/activesupport-3.2.21/lib/active_support/testing/assertions.rb:55:in `assert_difference'
/var/lib/workspace/workspace/test_develop/database/postgresql/ruby/1.9.3/test/functional/api/v2/external_usergroups_controller_test.rb:27:in `block in <class:ExternalUsergroupsControllerTest>'
/usr/local/rvm/gems/ruby-1.9.3-p392@test_develop-0/gems/minitest-4.7.5/lib/minitest/unit.rb:1258:in `run'
/usr/local/rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/test/unit/testcase.rb:17:in `run'
/usr/local/rvm/gems/ruby-1.9.3-p392@test_develop-0/gems/activesupport-3.2.21/lib/active_support/testing/setup_and_teardown.rb:36:in `block in run'
/usr/local/rvm/gems/ruby-1.9.3-p392@test_develop-0/gems/activesupport-3.2.21/lib/active_support/callbacks.rb:513:in `_run__2081058650913065530__setup__843367477971028187__callbacks'
/usr/local/rvm/gems/ruby-1.9.3-p392@test_develop-0/gems/activesupport-3.2.21/lib/active_support/callbacks.rb:405:in `__run_callback'
/usr/local/rvm/gems/ruby-1.9.3-p392@test_develop-0/gems/activesupport-3.2.21/lib/active_support/callbacks.rb:385:in `_run_setup_callbacks'
/usr/local/rvm/gems/ruby-1.9.3-p392@test_develop-0/gems/activesupport-3.2.21/lib/active_support/callbacks.rb:81:in `run_callbacks'
/usr/local/rvm/gems/ruby-1.9.3-p392@test_develop-0/gems/activesupport-3.2.21/lib/active_support/testing/setup_and_teardown.rb:35:in `run'
/usr/local/rvm/gems/ruby-1.9.3-p392@test_develop-0/gems/ci_reporter-1.9.3/lib/ci/reporter/minitest.rb:177:in `run_test'
/usr/local/rvm/gems/ruby-1.9.3-p392@test_develop-0/gems/ci_reporter-1.9.3/lib/ci/reporter/minitest.rb:102:in `_run_test'
/usr/local/rvm/gems/ruby-1.9.3-p392@test_develop-0/gems/ci_reporter-1.9.3/lib/ci/reporter/minitest.rb:93:in `block in _run_suite'
/usr/local/rvm/gems/ruby-1.9.3-p392@test_develop-0/gems/ci_reporter-1.9.3/lib/ci/reporter/minitest.rb:92:in `each'
/usr/local/rvm/gems/ruby-1.9.3-p392@test_develop-0/gems/ci_reporter-1.9.3/lib/ci/reporter/minitest.rb:92:in `_run_suite'
/usr/local/rvm/gems/ruby-1.9.3-p392@test_develop-0/gems/ci_reporter-1.9.3/lib/ci/reporter/minitest.rb:83:in `block in _run_suites'
/usr/local/rvm/gems/ruby-1.9.3-p392@test_develop-0/gems/ci_reporter-1.9.3/lib/ci/reporter/minitest.rb:83:in `map'
/usr/local/rvm/gems/ruby-1.9.3-p392@test_develop-0/gems/ci_reporter-1.9.3/lib/ci/reporter/minitest.rb:83:in `_run_suites'
/usr/local/rvm/gems/ruby-1.9.3-p392@test_develop-0/gems/ci_reporter-1.9.3/lib/ci/reporter/minitest.rb:75:in `_run_anything'
/usr/local/rvm/gems/ruby-1.9.3-p392@test_develop-0/gems/minitest-4.7.5/lib/minitest/unit.rb:1085:in `run_tests'
/usr/local/rvm/gems/ruby-1.9.3-p392@test_develop-0/gems/minitest-4.7.5/lib/minitest/unit.rb:1072:in `block in _run'
/usr/local/rvm/gems/ruby-1.9.3-p392@test_develop-0/gems/minitest-4.7.5/lib/minitest/unit.rb:1071:in `each'
/usr/local/rvm/gems/ruby-1.9.3-p392@test_develop-0/gems/minitest-4.7.5/lib/minitest/unit.rb:1071:in `_run'
/usr/local/rvm/gems/ruby-1.9.3-p392@test_develop-0/gems/minitest-4.7.5/lib/minitest/unit.rb:1059:in `run'
/usr/local/rvm/gems/ruby-1.9.3-p392@test_develop-0/gems/minitest-4.7.5/lib/minitest/unit.rb:795:in `block in autorun'

Related issues

Related to Foreman - Bug #9878: Deleteing an external AD user-group should disassociate the users from the user-group associatedClosed2015-03-24
Related to Foreman - Bug #9869: Foreman silently ignore all ldap exceptionsClosed2015-03-23

Associated revisions

Revision 05c84091 (diff)
Added by Daniel Lobato Garcia over 6 years ago

Fixes #10123 - Tests API v2 external user groups

The addition of a .refresh call after create, update and delete, caused
our tests to fail because of many failed calls to LDAP.
We can just expect the method to return true as we're not testing the
refresh functionality in these methods.

Revision efc01016 (diff)
Added by Daniel Lobato Garcia over 6 years ago

Fixes #10123 - Tests API v2 external user groups

The addition of a .refresh call after create, update and delete, caused
our tests to fail because of many failed calls to LDAP.
We can just expect the method to return true as we're not testing the
refresh functionality in these methods.

(cherry picked from commit 05c840915e26f3e177796cc4aa0e294e4f685846)

History

#1 Updated by Dominic Cleal over 6 years ago

  • Related to Bug #9878: Deleteing an external AD user-group should disassociate the users from the user-group associated added

#2 Updated by Dominic Cleal over 6 years ago

  • Related to Bug #9869: Foreman silently ignore all ldap exceptions added

#3 Updated by Dominic Cleal over 6 years ago

Reverting #9869 seems to fix the test, so perhaps an exception is being raised from the group membership code, instead of being stubbed?

#4 Updated by The Foreman Bot over 6 years ago

  • Status changed from New to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/2301 added
  • Pull request deleted ()

#5 Updated by Dominic Cleal over 6 years ago

  • Assignee set to Daniel Lobato Garcia

#6 Updated by Daniel Lobato Garcia over 6 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100

Also available in: Atom PDF