test: 테스트마다 sonner 주입 스타일시트를 걷어 역할 조회 지연 해소, 근거 없는 15초 연장 제거 - #62
Merged
Merged
Conversation
- 원인(계측): sonner가 import 때 97규칙짜리 <style>을 넣고, jsdom은 DOM이 바뀔 때마다 스타일 캐시를 버려 getComputedStyle이 모든 규칙을 다시 대조. 역할·이름 조회는 조회 1회에 getComputedStyle 약 139회 - CPU 프로파일: 역할 조회 868ms 중 657ms가 jsdom computed-style.js의 규칙 대조 - 조작 직후 셀 이름 조회 1회 66~68ms → 스타일시트 제거 시 21~23ms(변경 없으면 3.3ms) - setup.ts beforeEach에서 해당 <style> 제거. 전체 스위트(커버리지, 2회씩) 합계 133~138초 → 99초, 최장 2.5초 → 1.5초, 1초 초과 41~44개 → 21~24개, 실패 0 - banners·notifications 3곳의 15_000 연장 제거(근거 없던 연장, 수정 후 0.7~1.3초) - 회귀: sonner를 불러와도 테스트 시작 시점 문서에 그 스타일시트가 없다(setup 수정을 되돌리면 실패 확인)
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Coverage Report
File CoverageNo changed files found. |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
배경
<style>을 문서에 넣습니다(테스트에서 CSS 파일은 비워지므로 문서의 유일한 스타일시트).getComputedStyle에서 문서의 모든 규칙을 다시 대조합니다.getByRole(..., { name }))는 이름 계산과 보이는지 판단에 조회 1회당getComputedStyle을 약 139회 부릅니다.변경
src/test/setup.ts)의beforeEach에서 sonner 주입<style>을 제거합니다. jsdom에서 토스트 CSS는 쓸 데가 없습니다.}, 15_000)연장을 제거했습니다(수정 뒤 0.7~1.3초).src/test/infra/sonner-style.spec.ts: sonner를 불러와도 테스트 시작 시점 문서에 그 스타일시트가 없음.테스트
computed-style.js의 규칙 대조68ms → 스타일시트 제거 시 2123ms(DOM 변경이 없으면 3.3ms)138초 → 99초(−27%), 최장 2.5초 → 1.5초, 1초 초과 4144개 → 21~24개, 실패 0pnpm validate통과(93 files, 1148 tests).플랜 대조