Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

backend e2eテスト内で正常にテスト出来ていない項目が存在しそう #15309

Open
1 task
Sayamame-beans opened this issue Jan 18, 2025 · 1 comment
Labels
🐛Bug Unexpected behavior 🛠️Dev Development of Misskey itself packages/backend:test

Comments

@Sayamame-beans
Copy link
Member

💡 Summary

例えば

test('ミュートしているスレッドからメンションされても、ストリームに unreadMention イベントが流れてこない', () => new Promise<void>(async done => {
// 状態リセット
await api('i/read-all-unread-notes', {}, alice);
const bobNote = await post(bob, { text: '@alice @carol root note' });
await api('notes/thread-muting/create', { noteId: bobNote.id }, alice);
let fired = false;
const ws = await connectStream(alice, 'main', async ({ type, body }) => {
if (type === 'unreadMention') {
if (body === bobNote.id) return;
fired = true;
}
});

にて、

  • firedの初期値はfalse
  • unreadMentionイベントが流れてこなければfalseのまま
  • unreadMentionイベントが流れてきても、それが対象ユーザーであるbobNote,idの場合にearly returnしておりfalseのまま

となり、trueに(testがfailに)なることがない状態になっていたと見られます。( 72aa1cb で修正)
その他にも同様の事項がある可能性があり、確認が必要そうです。

(実際、9f94145 で修正したように、タイムラグがある部分で待機されておらず、"流れてくることがない"状態だったと見られる箇所もありました。)

備考: テスト内では"~ない"だけでなく、流れてくるはずというテストも含めた方が良いのかもしれません。

🥰 Expected Behavior

正常にテストされている

🤬 Actual Behavior

通るべきでないテストが通る状態になっている

📝 Steps to Reproduce

No response

💻 Frontend Environment

* Model and OS of the device(s):
* Browser:
* Server URL:
* Misskey:

🛰 Backend Environment (for server admin)

* Installation Method or Hosting Service:
* Misskey: https://github.com/misskey-dev/misskey/pull/15271 branch
* Node:
* PostgreSQL:
* Redis:
* OS and Architecture:

Do you want to address this bug yourself?

  • Yes, I will patch the bug myself and send a pull request
@Sayamame-beans
Copy link
Member Author

muteのe2e testの場合、waitFireしていないところが全滅かもです。
https://github.com/misskey-dev/misskey/blob/bb5157476275df391fc60284b293111369353124/packages/backend/test/e2e/mute.ts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛Bug Unexpected behavior 🛠️Dev Development of Misskey itself packages/backend:test
Projects
Development

No branches or pull requests

1 participant