Detect startup after recent crashes
This commit is contained in:
parent
02a732c511
commit
91f1b62bc7
23 changed files with 650 additions and 101 deletions
|
@ -8,7 +8,9 @@ import FormData from 'form-data';
|
|||
import * as util from 'util';
|
||||
import * as zlib from 'zlib';
|
||||
|
||||
import { upload } from '../../logging/debuglogs';
|
||||
import * as durations from '../../util/durations';
|
||||
import { upload } from '../../logging/uploadDebugLog';
|
||||
import * as logger from '../../logging/log';
|
||||
|
||||
const gzip: (_: zlib.InputType) => Promise<Buffer> = util.promisify(zlib.gzip);
|
||||
|
||||
|
@ -39,7 +41,7 @@ describe('upload', () => {
|
|||
|
||||
it('makes a request to get the S3 bucket, then uploads it there', async function test() {
|
||||
assert.strictEqual(
|
||||
await upload('hello world', '1.2.3'),
|
||||
await upload({ content: 'hello world', appVersion: '1.2.3', logger }),
|
||||
'https://debuglogs.org/abc123.gz'
|
||||
);
|
||||
|
||||
|
@ -47,6 +49,7 @@ describe('upload', () => {
|
|||
sinon.assert.calledWith(this.fakeGet, 'https://debuglogs.org', {
|
||||
responseType: 'json',
|
||||
headers: { 'User-Agent': 'Signal-Desktop/1.2.3 Linux' },
|
||||
timeout: { request: durations.MINUTE },
|
||||
});
|
||||
|
||||
const compressedContent = await gzip('hello world');
|
||||
|
@ -54,6 +57,7 @@ describe('upload', () => {
|
|||
sinon.assert.calledOnce(this.fakePost);
|
||||
sinon.assert.calledWith(this.fakePost, 'https://example.com/fake-upload', {
|
||||
headers: { 'User-Agent': 'Signal-Desktop/1.2.3 Linux' },
|
||||
timeout: { request: durations.MINUTE },
|
||||
body: sinon.match((value: unknown) => {
|
||||
if (!(value instanceof FormData)) {
|
||||
return false;
|
||||
|
@ -76,7 +80,7 @@ describe('upload', () => {
|
|||
|
||||
let err: unknown;
|
||||
try {
|
||||
await upload('hello world', '1.2.3');
|
||||
await upload({ content: 'hello world', appVersion: '1.2.3', logger });
|
||||
} catch (e) {
|
||||
err = e;
|
||||
}
|
||||
|
@ -102,7 +106,7 @@ describe('upload', () => {
|
|||
try {
|
||||
// Again, these should be run serially.
|
||||
// eslint-disable-next-line no-await-in-loop
|
||||
await upload('hello world', '1.2.3');
|
||||
await upload({ content: 'hello world', appVersion: '1.2.3', logger });
|
||||
} catch (e) {
|
||||
err = e;
|
||||
}
|
||||
|
@ -115,7 +119,7 @@ describe('upload', () => {
|
|||
|
||||
let err: unknown;
|
||||
try {
|
||||
await upload('hello world', '1.2.3');
|
||||
await upload({ content: 'hello world', appVersion: '1.2.3', logger });
|
||||
} catch (e) {
|
||||
err = e;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue