プロジェクト

全般

プロフィール

Vote #80768

未完了

IssuesSystemTest#test_index_as_csv_should_reflect_sort fails

Admin Redmine さんが約2年前に追加. 約2年前に更新.

ステータス:
New
優先度:
通常
担当者:
-
カテゴリ:
Code cleanup/refactoring_30
対象バージョン:
-
開始日:
2022/05/09
期日:
進捗率:

0%

予定工数:
category_id:
30
version_id:
0
issue_org_id:
33181
author_id:
332
assigned_to_id:
0
comments:
4
status_id:
1
tracker_id:
1
plus1:
0
affected_version:
closed_on:
affected_version_id:
127
ステータス-->[New]

説明

IssuesSystemTest#test_index_as_csv_should_reflect_sort fails in trunk or 4.1-stable.

$ bin/rails test test/system/issues_test.rb
Run options: --seed 47671

# Running:

Capybara starting Puma...
* Version 3.12.2 , codename: Llamas in Pajamas
* Min threads: 0, max threads: 4
* Listening on tcp://127.0.0.1:57898

F

Failure:
IssuesSystemTest#test_index_as_csv_should_reflect_sort [/Users/maeda/redmines/4.1-stable/test/system/issues_test.rb:365]:
--- expected
+++ actual
@@ -1 +1 @@
-["Add ingredients categories", "Blocked Issue", "Cannot print recipes", "Error 281 when updating a recipe", "Issue Doing the Blocking", "Issue due today", "Issue of a private subproject", "Private issue on public project", "Subproject issue", "Subproject issue two", "Subtask", "The quick brown fox jumps over the lazy dog", "test"]
+["test", "Subtask", "The quick brown fox jumps over the lazy dog", "Private issue on public project", "Issue Doing the Blocking", "Blocked Issue", "Issue due today", "Add ingredients categories", "Subproject issue two", "Issue of a private subproject", "Subproject issue", "Error 281 when updating a recipe", "Cannot print recipes"]



bin/rails test test/system/issues_test.rb:351

journals

The cause is probably that the file with the same name already exists at the download destination, and the download itself has not finished yet.
Depending on the test environment, a short wait will resolve the problem.

<pre><code class="diff">
diff --git a/test/system/issues_test.rb b/test/system/issues_test.rb
index 8352a792f..4eda9184a 100644
--- a/test/system/issues_test.rb
+++ b/test/system/issues_test.rb
@@ -359,6 +359,7 @@ class IssuesSystemTest < ApplicationSystemTestCase

# https://github.com/SeleniumHQ/selenium/issues/5292
# if issues.csv exists, Chrome creates issues (1).csv, issues (2).csv ...
+ sleep 0.2
csv = CSV.read(downloaded_file("issues*.csv"))
subject_index = csv.shift.index('Subject')
subjects = csv.map {|row| row[subject_index]}
</code></pre>
--------------------------------------------------------------------------------
Unfortunately, #33181#note-1 does not fix the problem in my environment. Maybe 0.2 seconds of sleep is not enough for the environment.

I think the following fix is independent of environments.

<pre><code class="diff">
diff --git a/test/application_system_test_case.rb b/test/application_system_test_case.rb
index f529f07e6..8632e7072 100644
--- a/test/application_system_test_case.rb
+++ b/test/application_system_test_case.rb
@@ -74,12 +74,9 @@ class ApplicationSystemTestCase < ActionDispatch::SystemTestCase
def downloaded_file(filename='*')
files = []
Timeout.timeout(5) do
- loop do
- files = downloaded_files(filename)
- break if files.present?
- sleep 0.2
- end
+ sleep 0.1 until downloaded?
end
+ files = downloaded_files(filename)
files.last
end
end
</code></pre>
--------------------------------------------------------------------------------
Setting the target version to 4.2.0.
--------------------------------------------------------------------------------
#33181#note-2 does not work. Maybe I misunderstood something.
--------------------------------------------------------------------------------

Admin Redmine さんが約2年前に更新

  • カテゴリCode cleanup/refactoring_30 にセット

他の形式にエクスポート: Atom PDF

いいね!0
いいね!0