Project

General

Profile

Actions

Patch #31967

closed

IssueCustomFieldTest randomly fails

Added by Yuichi HARADA over 4 years ago. Updated over 4 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Code cleanup/refactoring
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:

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
Actions

Also available in: Atom PDF