Skip to content

fix(backend): advanced-search e2eのフレーキーなoff-by-oneを堅牢化 - #1360

Open
4ster1sk wants to merge 1 commit into
yojo-art:1.11.xfrom
4ster1sk:fix/flaky-advanced-search-2200-1.11
Open

4ster1sk wants to merge 1 commit into
yojo-art:1.11.xfrom
4ster1sk:fix/flaky-advanced-search-2200-1.11

Conversation

@4ster1sk

Copy link
Copy Markdown
Contributor

What

packages/backend/test/e2e/advanced-search.tsfullIndexNote E2E準備処理を堅牢化しました(テストのみの変更、本体ロジックの変更なし)。

  • 2200件の notes/create 連打をステータス検証付きに変更し、失敗時は最大3回リトライ(失敗箇所の i と最終レスポンスをエラーメッセージに含める)
  • 投稿後の users/show.notesCount 確認を単発 strictEqual から60秒ポーリングに変更

Why

opensearch-e2e でフレーキーな失敗が発生していました:

AssertionError: Expected 2200 notes, but got 2199
at test/e2e/advanced-search.ts:72

連打中の1件の過渡失敗が無チェックの post() で黙って握りつぶされ、そのまま off-by-one になるのが原因と判断しました。notesCount の反映遅延も単発assertでは吸収できませんでした。

Additional info (optional)

  • 検証済み: pnpm buildpnpm --filter backend typecheckpnpm --filter backend eslint 通過
  • 未検証: OpenSearch実機での test:e2e:opensearch(要DB/Redis/OpenSearchのためCIでの確認が必要)
  • ベース: yojo-art/1.11.x、他ファイル・locale・migration・API定義の変更なし

Checklist

  • コントリビューションガイドを読みました( Read the contribution guide)
  • ローカル環境で動作しました(Test working in a local environment)
  • (必要なら)CHANGELOG_YOJO.mdの更新((If needed) Update CHANGELOG_YOJO.md)
  • (必要なら)テストの追加((If possible) Add tests)

2200連打中のnotes/create過渡失敗を検出できるようstatus検証+最大3回リトライを追加し、users/showのnotesCount確認を60秒ポーリング化 (CI: Expected 2200 notes, but got 2199 対策)
@codecov

codecov Bot commented Sep 14, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 23.24%. Comparing base (7f6293f) to head (a8e3845).
⚠️ Report is 6 commits behind head on 1.11.x.

Additional details and impacted files
@@            Coverage Diff             @@
##           1.11.x    #1360      +/-   ##
==========================================
- Coverage   23.68%   23.24%   -0.44%     
==========================================
  Files        1269     1267       -2     
  Lines       49135    48922     -213     
  Branches    14471    14433      -38     
==========================================
- Hits        11637    11373     -264     
- Misses      29599    29636      +37     
- Partials     7899     7913      +14     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@4ster1sk
4ster1sk changed the base branch from develop to 1.11.x September 14, 2026 13:36
@github-actions

Copy link
Copy Markdown
Contributor

Backend memory usage comparison

Before GC

Metric base (MB) head (MB) Diff (MB) Diff (%)
VmRSS 432.14 MB 457.82 MB +25.67 MB +5.94%
VmHWM 432.14 MB 457.82 MB +25.67 MB +5.94%
VmSize 3213.46 MB 3238.93 MB +25.47 MB +0.79%
VmData 2014.77 MB 2040.63 MB +25.86 MB +1.28%

After GC

Metric base (MB) head (MB) Diff (MB) Diff (%)
VmRSS 432.15 MB 457.62 MB +25.47 MB +5.89%
VmHWM 432.15 MB 457.68 MB +25.53 MB +5.90%
VmSize 3213.79 MB 3238.68 MB +24.89 MB +0.77%
VmData 2015.10 MB 2040.38 MB +25.28 MB +1.25%

After Request

Metric base (MB) head (MB) Diff (MB) Diff (%)
VmRSS 431.83 MB 457.78 MB +25.94 MB +6.00%
VmHWM 432.27 MB 457.93 MB +25.66 MB +5.93%
VmSize 3213.71 MB 3238.52 MB +24.81 MB +0.77%
VmData 2015.02 MB 2040.22 MB +25.19 MB +1.25%

⚠️ Warning: Memory usage has increased by more than 5%. Please verify this is not an unintended change.

See workflow logs for details

@github-actions

Copy link
Copy Markdown
Contributor

このPRによるapi.jsonの差分
差分はありません。
Get diff files from Workflow Page

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant