mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-17 23:35:34 +00:00
Bug 1154856 - Fix TelemetrySession test issues. r=vladan
This commit is contained in:
parent
18f2d0124a
commit
d922320c54
@ -604,13 +604,16 @@ let Impl = {
|
||||
", aOptions " + JSON.stringify(aOptions));
|
||||
|
||||
let pingData = this.assemblePing(aType, aPayload, aOptions);
|
||||
let archivePromise = this._archivePing(pingData)
|
||||
.catch(e => this._log.error("addPendingPing - Failed to archive ping " + pingData.id, e));
|
||||
|
||||
let savePromise = TelemetryFile.savePing(pingData, aOptions.overwrite);
|
||||
let archivePromise = this._archivePing(pingData).catch(e => {
|
||||
this._log.error("addPendingPing - Failed to archive ping " + pingData.id, e);
|
||||
});
|
||||
|
||||
// Wait for both the archiving and ping persistence to complete.
|
||||
let promises = [
|
||||
savePromise,
|
||||
archivePromise,
|
||||
TelemetryFile.savePing(pingData, aOptions.overwrite),
|
||||
];
|
||||
return Promise.all(promises).then(() => pingData.id);
|
||||
},
|
||||
@ -1076,7 +1079,8 @@ let Impl = {
|
||||
|
||||
const creationDate = new Date(aPingData.creationDate);
|
||||
const filePath = getArchivedPingPath(aPingData.id, creationDate, aPingData.type);
|
||||
yield OS.File.makeDir(OS.Path.dirname(filePath), { ignoreExisting: true });
|
||||
yield OS.File.makeDir(OS.Path.dirname(filePath), { ignoreExisting: true,
|
||||
from: OS.Constants.Path.profileDir });
|
||||
yield TelemetryFile.savePingToFile(aPingData, filePath, true);
|
||||
}),
|
||||
|
||||
|
@ -1703,9 +1703,8 @@ let Impl = {
|
||||
addClientId: true,
|
||||
addEnvironment: true,
|
||||
overwrite: true,
|
||||
filePath: file.path,
|
||||
};
|
||||
return TelemetryPing.addPendingPing(getPingType(payload), payload, options);
|
||||
return TelemetryPing.savePing(getPingType(payload), payload, file.path, options);
|
||||
},
|
||||
|
||||
/**
|
||||
@ -2071,7 +2070,7 @@ let Impl = {
|
||||
if (abortedExists) {
|
||||
this._log.trace("_checkAbortedSessionPing - aborted session found: " + FILE_PATH);
|
||||
yield this._abortedSessionSerializer.enqueueTask(
|
||||
() => TelemetryPing.addPendingPing(FILE_PATH, true));
|
||||
() => TelemetryPing.addPendingPingFromFile(FILE_PATH, true));
|
||||
}
|
||||
}),
|
||||
|
||||
|
@ -1582,6 +1582,7 @@ add_task(function* test_schedulerUserIdle() {
|
||||
// We should not miss midnight when going to idle.
|
||||
now.setHours(23);
|
||||
now.setMinutes(50);
|
||||
fakeNow(now);
|
||||
fakeIdleNotification("idle");
|
||||
Assert.equal(schedulerTimeout, 10 * 60 * 1000);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user