From af003fc0fef40e1c2506e9816f02a0d8cca1cbf8 Mon Sep 17 00:00:00 2001 From: Johann150 Date: Wed, 31 May 2023 12:42:13 +0200 Subject: [PATCH] try to fix test timeout (again) --- packages/backend/test/api-visibility.ts | 5 +++-- packages/backend/test/api.ts | 5 +++-- packages/backend/test/block.ts | 6 +++--- packages/backend/test/fetch-resource.ts | 5 +++-- packages/backend/test/ff-visibility.ts | 6 +++--- packages/backend/test/mute.ts | 6 +++--- packages/backend/test/note.ts | 6 +++--- packages/backend/test/services/blocking.ts | 6 +++--- packages/backend/test/streaming.ts | 16 ++++++++-------- packages/backend/test/thread-mute.ts | 6 +++--- packages/backend/test/user-notes.ts | 6 +++--- 11 files changed, 38 insertions(+), 35 deletions(-) diff --git a/packages/backend/test/api-visibility.ts b/packages/backend/test/api-visibility.ts index 6f1d51a67..18da1d0c9 100644 --- a/packages/backend/test/api-visibility.ts +++ b/packages/backend/test/api-visibility.ts @@ -4,11 +4,12 @@ import * as assert from 'assert'; import * as childProcess from 'child_process'; import { async, signup, request, post, startServer, shutdownServer } from './utils.js'; -describe('API visibility', () => { +describe('API visibility', function() { + this.timeout(20*60*1000); + let p: childProcess.ChildProcess; before(async () => { - this.timeout(0); p = await startServer(); }); diff --git a/packages/backend/test/api.ts b/packages/backend/test/api.ts index ae46ae92d..8bcef2ea2 100644 --- a/packages/backend/test/api.ts +++ b/packages/backend/test/api.ts @@ -4,14 +4,15 @@ import * as assert from 'assert'; import * as childProcess from 'child_process'; import { async, signup, request, post, react, uploadFile, startServer, shutdownServer } from './utils.js'; -describe('API', () => { +describe('API', function() { + this.timeout(20*60*1000); + let p: childProcess.ChildProcess; let alice: any; let bob: any; let carol: any; before(async () => { - this.timeout(0); p = await startServer(); alice = await signup({ username: 'alice' }); bob = await signup({ username: 'bob' }); diff --git a/packages/backend/test/block.ts b/packages/backend/test/block.ts index ec5d54ca0..b01096e80 100644 --- a/packages/backend/test/block.ts +++ b/packages/backend/test/block.ts @@ -4,7 +4,9 @@ import * as assert from 'assert'; import * as childProcess from 'child_process'; import { async, signup, request, post, startServer, shutdownServer } from './utils.js'; -describe('Block', () => { +describe('Block', function() { + this.timeout(20*60*1000); + let p: childProcess.ChildProcess; // alice blocks bob @@ -13,8 +15,6 @@ describe('Block', () => { let carol: any; before(async () => { - this.timeout(0); - p = await startServer(); alice = await signup({ username: 'alice' }); bob = await signup({ username: 'bob' }); diff --git a/packages/backend/test/fetch-resource.ts b/packages/backend/test/fetch-resource.ts index 2bdd7a7e2..ba1bf54a9 100644 --- a/packages/backend/test/fetch-resource.ts +++ b/packages/backend/test/fetch-resource.ts @@ -16,14 +16,15 @@ const AP = 'application/activity+json; charset=utf-8'; const JSON = 'application/json; charset=utf-8'; const HTML = 'text/html; charset=utf-8'; -describe('Fetch resource', () => { +describe('Fetch resource', function() { + this.timeout(20*60*1000); + let p: childProcess.ChildProcess; let alice: any; let alicesPost: any; before(async () => { - this.timeout(0); p = await startServer(); alice = await signup({ username: 'alice' }); alicesPost = await post(alice, { diff --git a/packages/backend/test/ff-visibility.ts b/packages/backend/test/ff-visibility.ts index 59b94e135..d71464a39 100644 --- a/packages/backend/test/ff-visibility.ts +++ b/packages/backend/test/ff-visibility.ts @@ -4,7 +4,9 @@ import * as assert from 'assert'; import * as childProcess from 'child_process'; import { async, signup, request, post, react, connectStream, startServer, shutdownServer, simpleGet } from './utils.js'; -describe('FF visibility', () => { +describe('FF visibility', function() { + this.timeout(20*60*1000); + let p: childProcess.ChildProcess; let alice: any; @@ -12,8 +14,6 @@ describe('FF visibility', () => { let follower: any; before(async () => { - this.timeout(0); - p = await startServer(); alice = await signup({ username: 'alice' }); bob = await signup({ username: 'bob' }); diff --git a/packages/backend/test/mute.ts b/packages/backend/test/mute.ts index 602623f4b..178018eea 100644 --- a/packages/backend/test/mute.ts +++ b/packages/backend/test/mute.ts @@ -4,7 +4,9 @@ import * as assert from 'assert'; import * as childProcess from 'child_process'; import { async, signup, request, post, react, startServer, shutdownServer, waitFire } from './utils.js'; -describe('Mute', () => { +describe('Mute', function() { + this.timeout(20*60*1000); + let p: childProcess.ChildProcess; // alice mutes carol @@ -13,8 +15,6 @@ describe('Mute', () => { let carol: any; before(async () => { - this.timeout(0); - p = await startServer(); alice = await signup({ username: 'alice' }); bob = await signup({ username: 'bob' }); diff --git a/packages/backend/test/note.ts b/packages/backend/test/note.ts index 1f7cf8f03..0f10f5ff9 100644 --- a/packages/backend/test/note.ts +++ b/packages/backend/test/note.ts @@ -5,7 +5,9 @@ import * as childProcess from 'child_process'; import { Note } from '../src/models/entities/note.js'; import { async, signup, request, post, uploadUrl, startServer, shutdownServer, initTestDb, api } from './utils.js'; -describe('Note', () => { +describe('Note', function() { + this.timeout(20*60*1000); + let p: childProcess.ChildProcess; let Notes: any; @@ -13,8 +15,6 @@ describe('Note', () => { let bob: any; before(async () => { - this.timeout(0); - p = await startServer(); const connection = await initTestDb(true); Notes = connection.getRepository(Note); diff --git a/packages/backend/test/services/blocking.ts b/packages/backend/test/services/blocking.ts index 2f72972f2..122e8126e 100644 --- a/packages/backend/test/services/blocking.ts +++ b/packages/backend/test/services/blocking.ts @@ -5,7 +5,9 @@ import * as childProcess from 'child_process'; import * as sinon from 'sinon'; import { async, signup, startServer, shutdownServer, initTestDb } from '../utils.js'; -describe('Creating a block activity', () => { +describe('Creating a block activity', function() { + this.timeout(20*60*1000); + let p: childProcess.ChildProcess; // alice blocks bob @@ -14,8 +16,6 @@ describe('Creating a block activity', () => { let carol: any; before(async () => { - this.timeout(0); - await initTestDb(); p = await startServer(); alice = await signup({ username: 'alice' }); diff --git a/packages/backend/test/streaming.ts b/packages/backend/test/streaming.ts index dd0e814d4..ad326703d 100644 --- a/packages/backend/test/streaming.ts +++ b/packages/backend/test/streaming.ts @@ -24,7 +24,9 @@ describe('Streaming', () => { }); }; - describe('Streaming', () => { + describe('Streaming', function() { + this.timeout(20*60*1000); + // Local users let ayano: any; let kyoko: any; @@ -38,8 +40,6 @@ describe('Streaming', () => { let list: any; before(async () => { - this.timeout(0); - p = await startServer(); const connection = await initTestDb(true); Followings = connection.getRepository(Following); @@ -410,7 +410,7 @@ describe('Streaming', () => { let fooCount = 0; let barCount = 0; let fooBarCount = 0; - + const ws = await connectStream(chitose, 'hashtag', ({ type, body }) => { if (type == 'note') { if (body.text === '#foo') fooCount++; @@ -422,19 +422,19 @@ describe('Streaming', () => { ['foo', 'bar'], ], }); - + post(chitose, { text: '#foo', }); - + post(chitose, { text: '#bar', }); - + post(chitose, { text: '#foo #bar', }); - + setTimeout(() => { assert.strictEqual(fooCount, 0); assert.strictEqual(barCount, 0); diff --git a/packages/backend/test/thread-mute.ts b/packages/backend/test/thread-mute.ts index d1338fd3b..d4ca80af6 100644 --- a/packages/backend/test/thread-mute.ts +++ b/packages/backend/test/thread-mute.ts @@ -4,7 +4,9 @@ import * as assert from 'assert'; import * as childProcess from 'child_process'; import { async, signup, request, post, react, connectStream, startServer, shutdownServer } from './utils.js'; -describe('Note thread mute', () => { +describe('Note thread mute', function() { + this.timeout(20*60*1000); + let p: childProcess.ChildProcess; let alice: any; @@ -12,8 +14,6 @@ describe('Note thread mute', () => { let carol: any; before(async () => { - this.timeout(0); - p = await startServer(); alice = await signup({ username: 'alice' }); bob = await signup({ username: 'bob' }); diff --git a/packages/backend/test/user-notes.ts b/packages/backend/test/user-notes.ts index 31a66dbd2..9d11d2304 100644 --- a/packages/backend/test/user-notes.ts +++ b/packages/backend/test/user-notes.ts @@ -4,7 +4,9 @@ import * as assert from 'assert'; import * as childProcess from 'child_process'; import { async, signup, request, post, uploadUrl, startServer, shutdownServer } from './utils.js'; -describe('users/notes', () => { +describe('users/notes', function() { + this.timeout(20*60*1000); + let p: childProcess.ChildProcess; let alice: any; @@ -13,8 +15,6 @@ describe('users/notes', () => { let jpgPngNote: any; before(async () => { - this.timeout(0); - p = await startServer(); alice = await signup({ username: 'alice' }); const jpg = await uploadUrl(alice, 'https://raw.githubusercontent.com/misskey-dev/misskey/develop/packages/backend/test/resources/Lenna.jpg');