spec(backend/notes/create): ネットワーク不安定・高負荷時ノートが重複して投稿される問題を修正 (MisskeyIO#432)

This commit is contained in:
まっちゃとーにゅ 2024-02-11 04:02:34 +09:00 committed by GitHub
parent f07a701418
commit 43ef9ca4e2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 51 additions and 6 deletions

View file

@ -8,7 +8,7 @@ process.env.NODE_ENV = 'test';
import * as assert from 'assert';
import { MiNote } from '@/models/Note.js';
import { MAX_NOTE_TEXT_LENGTH } from '@/const.js';
import { api, initTestDb, post, signup, uploadFile, uploadUrl } from '../utils.js';
import { api, initTestDb, post, sendEnvUpdateRequest, signup, uploadFile, uploadUrl } from '../utils.js';
import type * as misskey from 'misskey-js';
describe('Note', () => {
@ -19,6 +19,8 @@ describe('Note', () => {
let tom: misskey.entities.SignupResponse;
beforeAll(async () => {
await sendEnvUpdateRequest({ key: 'FORCE_IGNORE_IDEMPOTENCY_FOR_TESTING', value: 'true' });
const connection = await initTestDb(true);
Notes = connection.getRepository(MiNote);
alice = await signup({ username: 'alice' });