Api test: SmtpMailer times out under load

Open
#830 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
68/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
typescript
Domain
testing

Research direction

Start with apps/api/src/adapters/smtp/SmtpMailer.test.ts and trace how each test starts and finishes its send, and when it clears Mailpit. Set a suite timeout above the mailer's roughly eight-second limits and make each test await its in-flight send before cleanup. Verify the API test command passes ten consecutive runs under load, then run pnpm gate.

Written by the indexing model from the issue text.

Description

needs-triage

Found in the review of #828. apps/api/src/adapters/smtp/SmtpMailer.test.ts timed out in two local gate runs; CI stayed green (2.3 s).

Context

The test uses real SMTP on wall-clock time under Vitest's default 5 s limit, while the mailer's own timeouts add up to about 8 s. A send that outlives its test can land after the next test's Mailpit DELETE. This reading comes from the code; it was not reproduced.

Done when

  • The suite sets an explicit timeout above the mailer's own limits.
  • Each test waits for its in-flight send before the next test clears Mailpit, observing the transition rather than sampling.
  • pnpm --filter @mygame/api test passes ten runs in a row under load.
  • pnpm gate green.
Dominant language
TypeScript
Stars
1
Forks
0
Avg merge
30m
Merged PRs (30d)
219

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from emm3000/myGame

All issues in emm3000/myGame

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.