Closed Bug 1802068 Opened 1 year ago Closed 1 year ago

Port bug 1772930 to Thunderbird - comm/chat/components/src/test/test_logger.js | Starting test_appendToFileHeader is failing

Categories

(Thunderbird :: Upstream Synchronization, task)

Tracking

(thunderbird_esr102 unaffected)

RESOLVED FIXED
109 Branch
Tracking Status
thunderbird_esr102 --- unaffected

People

(Reporter: mkmelin, Assigned: mkmelin)

References

Details

(Keywords: intermittent-failure)

Attachments

(2 files, 1 obsolete file)

+++ This bug was initially created as a clone of Bug #1772930 +++

Some porting of at least https://hg.mozilla.org/mozilla-central/rev/7e712d8f5d3e needed.

comm/chat/components/src/test/test_logger.js | Starting test_appendToFileHeader
[task 2022-11-23T01:18:06.662Z] 01:18:06 INFO - Unexpected exception NoModificationAllowedError: Refusing to overwrite the file at /tmp/xpc-profile-kd65x8ba/headerTestFile.txt
[task 2022-11-23T01:18:06.662Z] 01:18:06 INFO - Specify mode: "overwrite" to allow overwriting the destination
[task 2022-11-23T01:18:06.662Z] 01:18:06 INFO - _do_main@/builds/worker/workspace/build/tests/xpcshell/head.js:238:6
[task 2022-11-23T01:18:06.663Z] 01:18:06 INFO - _execute_test@/builds/worker/workspace/build/tests/xpcshell/head.js:588:5

Yes, making it const mode = aCreate ? "overwrite" : "append"; instead fixes the test failure.
But I'm not sure that's correct. The test seems to test unreasonable behavior really - https://searchfox.org/comm-central/rev/b175fe607e2b841970c7f6c34e636ef1bcb26c22/chat/components/src/test/test_logger.js#283-286

Given this is only used with create true in startNewFile(), perhaps it's reasonable.
Perhaps even better to just remove the whole appendToFile function... but leaving it for now.

Assignee: nobody → mkmelin+mozilla
Status: NEW → ASSIGNED

Pushed by mkmelin@iki.fi:
https://hg.mozilla.org/comm-central/rev/fe4df9e8f1f8
Port bug 1772930 to Thunderbird - comm/chat/components/src/test/test_logger.js | Starting test_appendToFileHeader is failing. rs=#bustage-fix

Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED

Pushed as bustage fix. Martin, please check it out once you're back.

Flags: needinfo?(martin)
Target Milestone: --- → 109 Branch

Responding as "spare time chat peer" here. That is almost certainly the wrong fix, since that part of code is never supposed to overwrite existing files. However, we're expecting some files to already exist sometimes, which is why there's error handling ignoring the overwrite error in some cases. What I tried to point out, was that the detection that it was an overwrite error was likely wrong and had changed in that patch.

Flags: needinfo?(martin)

Well, that's what I'm saying, the test is testing very dubious behavior (that it can write with create twice and nothing bad would happen). I don't have any reason to think it happens in real usage.

It can, due to the filenames being timestamp based. You can also see the same failure in browser_logs.js

Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Attachment #9305019 - Attachment is obsolete: true

Pushed by mkmelin@iki.fi:
https://hg.mozilla.org/comm-central/rev/0c1b14c0b7b2
Better fix for appendToFile with create and file existing. r=freaktechnik

Status: REOPENED → RESOLVED
Closed: 1 year ago1 year ago
Resolution: --- → FIXED
See Also: → 1881982
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: