Patch #31967

IssueCustomFieldTest randomly fails

Added by Yuichi HARADA 22 days ago. Updated 22 days ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:Go MAEDA% Done:

0%

Category:Code cleanup/refactoring
Target version:4.1.0

Description

IssueCustomFieldTest fails in the following procedure.

$ RAILS_ENV=test bundle exec rake db:migrate:reset

$ RAILS_ENV=test bundle exec rake test TEST=test/unit/issue_custom_field_test.rb
Run options: --seed 7200

# Running:

E

Error:
IssueCustomFieldTest#test_changing_visible_to_true_should_clear_roles:
ActiveRecord::RecordNotFound: Couldn't find IssueCategory with 'id'=1
    test/unit/issue_custom_field_test.rb:29:in `setup'

bin/rails test test/unit/issue_custom_field_test.rb:41

E

Error:
IssueCustomFieldTest#test_custom_field_with_visible_set_to_false_should_validate_roles:
ActiveRecord::RecordNotFound: Couldn't find IssueCategory with 'id'=1
    test/unit/issue_custom_field_test.rb:29:in `setup'

bin/rails test test/unit/issue_custom_field_test.rb:32

Finished in 0.015735s, 127.1052 runs/s, 0.0000 assertions/s.
2 runs, 0 assertions, 0 failures, 2 errors, 0 skips

Solved by the following patch.

diff --git a/test/unit/issue_custom_field_test.rb b/test/unit/issue_custom_field_test.rb
index f6e6d4863..321dceb43 100644
--- a/test/unit/issue_custom_field_test.rb
+++ b/test/unit/issue_custom_field_test.rb
@@ -26,7 +26,6 @@ class IssueCustomFieldTest < ActiveSupport::TestCase

   def setup
     User.current = nil
-    @category = IssueCategory.find(1)
   end

   def test_custom_field_with_visible_set_to_false_should_validate_roles

Associated revisions

Revision 18409
Added by Go MAEDA 22 days ago

IssueCustomFieldTest randomly fails (#31967).

Patch by Yuichi HARADA.

History

#1 Updated by Go MAEDA 22 days ago

  • Subject changed from IssueCustomFieldTest failed to IssueCustomFieldTest randomly fails
  • Target version set to 4.1.0

The instance variable @category has never used in issue_custom_field_test.rb. Probably the line was mistakenly added in r17761.

Setting the target version to 4.1.0.

#2 Updated by Go MAEDA 22 days ago

  • Status changed from New to Closed
  • Assignee set to Go MAEDA

Committed the fix. Thanks.

Also available in: Atom PDF