Bug 1542362 (xpcshell test only) - Fix intermittent marAppApplyUpdateStageSuccessSvc.js failure. r=bytesized, a=testonly
authorRobert Strong <robert.bugzilla@gmail.com>
Tue, 21 May 2019 10:29:47 -0700
changeset 536377 958825ce740165cc1afe064deed6bb8d0be6864c
parent 536376 4a8ed8b764d0cad9d0c833abd17d167ed84c6281
child 536378 e9d9035e11e58302276689eeda113513ab1165de
push id2082
push userffxbld-merge
push dateMon, 01 Jul 2019 08:34:18 +0000
treeherdermozilla-release@2fb19d0466d2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbytesized, testonly
bugs1542362
milestone68.0
Bug 1542362 (xpcshell test only) - Fix intermittent marAppApplyUpdateStageSuccessSvc.js failure. r=bytesized, a=testonly When there were multiple matches the regexp included the newline from the previous match which caused the next match to fail Differential Revision: https://phabricator.services.mozilla.com/D31739
toolkit/mozapps/update/tests/data/xpcshellUtilsAUS.js
--- a/toolkit/mozapps/update/tests/data/xpcshellUtilsAUS.js
+++ b/toolkit/mozapps/update/tests/data/xpcshellUtilsAUS.js
@@ -2877,20 +2877,20 @@ function checkUpdateLogContents(aCompare
     updateLogContents = updateLogContents.replace(/^ensure_remove: failed to remove file: .*$/mg, "");
     updateLogContents = updateLogContents.replace(/^ensure_remove_recursive: unable to remove directory: .*$/mg, "");
     updateLogContents = updateLogContents.replace(/^Removing tmpDir failed, err: -1$/mg, "");
     updateLogContents = updateLogContents.replace(/^remove_recursive_on_reboot: .*$/mg, "");
     // Replace requests will retry renaming the installation directory 10 times
     // when there are files still in use. The following will remove the
     // additional entries from the log file when this happens so the log check
     // passes.
-    let re = new RegExp("\n" + ERR_RENAME_FILE + "[^\n]*\n" +
+    let re = new RegExp(ERR_RENAME_FILE + "[^\n]*\n" +
                         "PerformReplaceRequest: destDir rename[^\n]*\n" +
                         "rename_file: proceeding to rename the directory\n", "g");
-    updateLogContents = updateLogContents.replace(re, "\n");
+    updateLogContents = updateLogContents.replace(re, "");
   }
 
   // Replace error codes since they are different on each platform.
   updateLogContents = updateLogContents.replace(/, err:.*\n/g, "\n");
   // Replace to make the log parsing happy.
   updateLogContents = updateLogContents.replace(/non-fatal error /g, "");
   // Remove consecutive newlines
   updateLogContents = updateLogContents.replace(/\n+/g, "\n");