test(whatsapp): cover npm install timeout#26795
Open
haran2001 wants to merge 1 commit into
Open
Conversation
austinpickett
requested changes
May 18, 2026
austinpickett
left a comment
Collaborator
There was a problem hiding this comment.
Please use PULL_REQUEST_TEMPLATE.md
Contributor
There was a problem hiding this comment.
Pull request overview
Adds regression test coverage for the WhatsApp bridge npm install timeout, verifying that the new 300s default is in effect and the WHATSAPP_NPM_INSTALL_TIMEOUT env override is honored.
Changes:
- Extracts the
node_modules-missing path predicate into a shared static helper onTestConnectCleanup. - Adds a test confirming the default
subprocess.runtimeout is 300 seconds when the env var is unset. - Adds a test confirming
WHATSAPP_NPM_INSTALL_TIMEOUT=600overrides the default.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Contributor
Author
|
Reformatted the description to match |
austinpickett
approved these changes
May 18, 2026
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.
What does this PR do?
The WhatsApp gateway bridge runs
npm installto set up its Node dependencies on first connect. That call previously used the default 60s subprocess timeout, which fired on slower NAS/container hosts and aborted the install partway through. The default was raised to 300s and an env override (WHATSAPP_NPM_INSTALL_TIMEOUT) was added; this PR adds regression coverage so neither change can silently regress.Related Issue
Fixes #14980
Type of Change
Changes Made
tests/gateway/test_whatsapp_connect.py:node_modules-missing predicate into a sharedTestConnectCleanupstatic helper to deduplicate setup across the new tests.test_npm_install_uses_default_timeout— assertssubprocess.runis called withtimeout=300whenWHATSAPP_NPM_INSTALL_TIMEOUTis unset.test_npm_install_honors_env_override— assertsWHATSAPP_NPM_INSTALL_TIMEOUT=600overrides the default and is passed through tosubprocess.run.How to Test
python -m pytest tests/gateway/test_whatsapp_connect.py -q -o 'addopts='git diff --checkis clean.Checklist
Code
test(whatsapp):)Documentation & Housekeeping
cli-config.yaml.exampleif I added/changed config keys — N/ACONTRIBUTING.mdorAGENTS.mdif I changed architecture or workflows — N/Asubprocess.run, no platform-specific behaviorScreenshots / Logs