https://www.redmine.org/https://www.redmine.org/favicon.ico?16793021292018-10-30T21:55:02ZRedmineRedmine - Defect #29883: AttachmentsVisibilityTest and Redmine::AttachmentFieldFormatTest fail randomly due to uninitialized User.currenthttps://www.redmine.org/issues/29883?journal_id=881832018-10-30T21:55:02ZGilad Shanan
<ul><li><strong>File</strong> <a href="/attachments/21741">0001-Fix-spurious-spec-failures.patch</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/21741/0001-Fix-spurious-spec-failures.patch">0001-Fix-spurious-spec-failures.patch</a> added</li></ul><p>Another related spec failure can be reproduced like this:</p>
<pre>
bin/rails test test/integration/api_test/authentication_test.rb test/unit/lib/redmine/field_format/attachment_format_test.rb --seed 53775
=>
Failure:
Redmine::AttachmentFieldFormatTest#test_should_accept_a_hash_with_upload_on_create [/Users/gilad/Workspace/redmine/test/unit/lib/redmine/field_format/attachment_format_test.rb:45]:
--- expected
+++ actual
@@ -1 +1 @@
-#<CustomValue id: 284, customized_type: "Principal", customized_id: 133, custom_field_id: 46, value: "69">
+nil
Failure:
Redmine::AttachmentFieldFormatTest#test_should_replace_attachment_on_update [/Users/gilad/Workspace/redmine/test/unit/lib/redmine/field_format/attachment_format_test.rb:123]:
"Attachment.count" didn't change by 0.
Expected: 21
Actual: 22
</pre>
<p>I've update the patch to address this as well.</p> Redmine - Defect #29883: AttachmentsVisibilityTest and Redmine::AttachmentFieldFormatTest fail randomly due to uninitialized User.currenthttps://www.redmine.org/issues/29883?journal_id=881982018-10-31T13:15:53ZGo MAEDA
<ul><li><strong>Target version</strong> set to <i>4.1.0</i></li></ul><p>I know the test fails from time to time but I didn't know the reason. Thank you for investigating that.</p>
<p>The patch looks good. Setting target version to 4.1.0.</p> Redmine - Defect #29883: AttachmentsVisibilityTest and Redmine::AttachmentFieldFormatTest fail randomly due to uninitialized User.currenthttps://www.redmine.org/issues/29883?journal_id=882242018-11-03T07:17:51ZGo MAEDA
<ul><li><strong>Subject</strong> changed from <i>AttachmentsVisibilityTest missing setup step User.current = nil</i> to <i>AttachmentsVisibilityTest and Redmine::AttachmentFieldFormatTest fail randomly due to uninitialized User.current</i></li><li><strong>Status</strong> changed from <i>New</i> to <i>Closed</i></li><li><strong>Assignee</strong> set to <i>Go MAEDA</i></li><li><strong>Target version</strong> changed from <i>4.1.0</i> to <i>4.0.0</i></li><li><strong>Resolution</strong> set to <i>Fixed</i></li></ul><p>Committed. Thank you for fixing those hard to find issues.</p>