Project

General

Profile

Actions

Defect #39180

closed

Fix an intermittent test failure in JournalTest

Added by Vincent Robert about 1 year ago. Updated about 1 year ago.

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

0%

Estimated time:
Resolution:
Fixed
Affected version:

Description

This test occasionally fails when executed concurrently with CI tools.

diff --git a/test/unit/journal_test.rb b/test/unit/journal_test.rb
class JournalTest < ActiveSupport::TestCase
  def test_notified_mentions_should_not_include_users_who_cannot_view_private_notes
    journal = Journal.generate!(journalized: Issue.find(2), user: User.find(1), private_notes: true, notes: 'Hello @dlopper, @jsmith and @admin.')

    # User "dlopper" has "Developer" role on project "eCookbook" 
    # Role "Developer" does not have the "View private notes" permission
-   assert_equal [1, 2], journal.notified_mentions.map(&:id)
+   assert_equal [1, 2], journal.notified_mentions.map(&:id).sort
   end
 end
Actions #1

Updated by Go MAEDA about 1 year ago

  • Tracker changed from Patch to Defect
  • Subject changed from Fixing an intermittent test failure when running tests concurrently to Fix an intermittent test failure in JournalTest
  • Category set to Code cleanup/refactoring
  • Status changed from New to Closed
  • Assignee set to Go MAEDA
  • Target version set to 5.1.0
  • Resolution set to Fixed

Committed the fix in r22336. Thank you.

Actions

Also available in: Atom PDF