Skip to content

PM-6601: Unblock production build (stop tc-communities tests leaking rejections) - #7293

Merged
jmgasper merged 1 commit into
masterfrom
hotfix/PM-6601-production-build
Oct 22, 2026
Merged

jmgasper merged 1 commit into
masterfrom
hotfix/PM-6601-production-build

Conversation

@jmgasper

@jmgasper jmgasper commented Oct 22, 2026 •

Copy link
Copy Markdown
Collaborator

Jira: PM-6601

What was broken

The PM-6601 fix (#7286) reached master in the October 2026 Release 3 merge (#7291), but production was never redeployed. build-prod #18513 failed in npm test, so no image was pushed. Production ECS is still on community-app:18501 from 2026-10-08. The live article still shows &lt;TesterClassName&gt;, while dev renders <TesterClassName>.

The same test fails in develop build-dev (#18511, #18516) and in the PM-6628 branch test job (#18510).

Root cause

The failing test, community-csp.js, was not the source of the error. __tests__/shared/containers/tc-communities/JoinCommunity.jsx leaves rejected promises behind:

  • The Terms child container loads metadata for community 1 on every mount, and that lookup fails.
  • Its join test dispatches the real joinDone. That posts to the live Groups API through topcoder-react-lib's own fetch, so the test's global.fetch mock never sees it, and the unauthenticated request gets a 401.

redux-mock-store does not settle action payloads. Jest 23 fails whichever spec is running when an unhandled rejection arrives. In CircleCI, the next file in that worker is community-csp.js, so its first case gets the Unauthorized. The tc-communities actions test makes the same live request when the file loads.

What was changed

Test-only:

  • Stub the groups service in both suites.
  • In the container test, replace containers/Terms with a null component. That test only asserts on JoinCommunity actions.

No application code changed.

Tests

  • The actions test now asserts that the joinDone payload resolves through the groups service without a network request. This restores the assertion left commented out since topcoder-react-lib v0.3.0.
  • Running the container and CSP suites in one worker (--runInBand) failed 6 CSP tests before this change. Three runs after it pass with no leaked rejections.

Validation (Node 10.24.1)

  • npm test (eslint, stylelint, retired-CMS check, Jest): 175 suites, 495 passed, 23 already skipped, 141 snapshots
  • npm run build: passed

A matching PR to develop carries the same commit so dev deploys resume.

🤖 Generated with Claude Code

What was broken

The production build has failed since the October 2026 Release 3 merge, so
the PM-6601 angle-bracket fix never reached production. CircleCI build-prod
#18513 stopped at npm test with community-csp.js reporting "Unauthorized"
from the groups service. Develop build-dev and branch test jobs fail the same
way, so develop is not deploying either.

Root cause

The JoinCommunity container test mounts the Terms container, which loads
metadata for community "1" on every mount, and its join test dispatches the
real joinDone action. joinDone posts to the live Groups API through
topcoder-react-lib's own fetch, which the test's global.fetch mock never
intercepts. redux-mock-store does not settle action payloads, so the
metadata failures and the 401 rejection stay unhandled. Jest 23 fails
whichever spec is running when they arrive. In CircleCI that is the first
community-csp.js case, which runs next in the same worker. The
tc-communities actions test makes the same unauthenticated request when the
file loads.

What was changed

Stub the groups service in both suites. Replace the Terms container with a
null component in the container test, which only asserts on JoinCommunity
actions. No application code changed.

Any added/updated tests

The actions test now verifies that the joinDone payload resolves through
the groups service without a network request. This restores the assertion
left commented out since topcoder-react-lib v0.3.0. Running the container
and CSP suites in one worker failed 6 CSP tests before this change. Three
runs after it pass with no leaked rejections.

Validation: npm test (lint, stylelint, retired-CMS check, 495 passed, 23
already skipped, 141 snapshots) and npm run build pass under Node 10.24.1.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jmgasper
jmgasper requested a review from kkartunov as a code owner October 22, 2026 21:01
@jmgasper
jmgasper merged commit 5a84239 into master Oct 22, 2026
6 of 7 checks passed
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