Skip to content

test(integration): give afterAll teardown the 60s hookTimeout (LAB-3756) - #124

Open
27Bslash6 wants to merge 1 commit into
mainfrom
lab-3756-integration-hook-timeout
Open

27Bslash6 wants to merge 1 commit into
mainfrom
lab-3756-integration-hook-timeout

Conversation

@27Bslash6

@27Bslash6 27Bslash6 commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

Description

This PR adds a hookTimeout configuration of 60 seconds to the Vitest integration test configuration.

What Changed

In packages/cachekit/vitest.integration.config.ts, a hookTimeout: 60000 setting was added alongside the existing testTimeout: 60000.

Why

By default, Vitest applies the testTimeout value only to individual test cases, but setup/teardown hooks (beforeAll, afterAll, beforeEach, afterEach) use a separate, shorter default hookTimeout. As the PR title indicates, the goal is to give the afterAll teardown the same 60-second timeout as the tests themselves.

Impact

This prevents integration test hooks—particularly teardown logic that may involve slow operations like cleaning up external resources or cache connections—from timing out prematurely and causing flaky or failing test runs.

vitest.integration.config.ts set testTimeout: 60000 but left hookTimeout at
vitest's 10s default. The Redis and Memcached Testcontainers suites pass
60000 to beforeAll explicitly, but their afterAll (client quit + container
stop) takes no timeout argument, so teardown ran on the 10s default and
could fail the lane after every test in it had passed. The report reads
"Hook timed out in 10000ms" with a code frame pointing at the beforeAll
closing line, which misdirects to setup.

Setting hookTimeout at the config level gives teardown the same budget as
setup and covers any future Testcontainers suite without per-hook arguments.
@coderabbitai

coderabbitai Bot commented Sep 16, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Team

Run ID: c0805e75-596a-4275-9a31-14ceffca2fd9

📥 Commits

Reviewing files that changed from the base of the PR and between c93083b and 4167a95.

📒 Files selected for processing (1)
  • packages/cachekit/vitest.integration.config.ts

Included review availability: 2 reviews are currently available. Your included PR review attempts over the past 7 days set your current allowance at 3 reviews per hour.


Walkthrough

The Vitest integration test configuration now sets hookTimeout to 60000 milliseconds.

Changes

Integration test configuration

Layer / File(s) Summary
Configure Vitest hook timeout
packages/cachekit/vitest.integration.config.ts
The integration test configuration sets the Vitest hookTimeout to 60000 milliseconds.

Priority: ⬇️ Low

Estimated code review effort: 1 (Trivial) | ~2 minutes

Change: Bug fix

Merge Risk: ⚪ Minimal · up to 4167a

The integration test hook timeout is increased to 60 seconds, with no remaining evidence of a merge-blocking issue.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: increasing Vitest integration hook timeout to 60 seconds for teardown operations. It is concise and includes the relevant issue identifier.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch lab-3756-integration-hook-timeout

Comment @coderabbitai help to get the list of available commands.

@kodus-27b

kodus-27b Bot commented Sep 16, 2026

Copy link
Copy Markdown

Kody Review Complete

Great news! 🎉
No issues were found that match your current review configurations.

Keep up the excellent work! 🚀

Kody Guide: Usage and Configuration
Interacting with Kody
  • Request a Review: Ask Kody to review your PR manually by adding a comment with the @kody start-review command at the root of your PR.

  • Validate Business Logic: Ask Kody to validate your code against business rules by adding a comment with the @kody -v business-logic command.

  • Provide Feedback: Help Kody learn and improve by reacting to its comments with a 👍 for helpful suggestions or a 👎 if improvements are needed.

Current Kody Configuration
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug
Performance
Security
Business Logic

Access your configuration settings here.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant