TOPIC 28/6214 MINNOT STARTED

Testing connections to outside services

Outside services can be slow, fail or change. Learn to test the sandbox, the timeout and the day the provider changes.

L1–L4 are part of the Pro pass

L0 Explain simply

Analogy: borrowing a neighbour's ladder. You borrow a ladder from the house next door. It works well until the neighbour changes it, moves it or locks the shed. You do not control when its owner replaces it. You can check how you use it and plan for the day it is not there.

Daily List is a to-do list app. Its paid plan uses an outside billing service. Its reminders use an outside mail service. Its calendar link uses an outside calendar. Leo, the developer, did not build any of them. He cannot repair their internals, but he can fix Daily List’s own requests and settings.

Tom, the tester, asks the questions a careful borrower asks. What if the billing service is slow? What if it says no? What if it changes the shape of its answers next month? He tests the app's side of each case.

These are third-party connections: links to services that other companies run. A fault may be in the provider, the network or Daily List’s own caller and settings. Tom collects boundary evidence before assigning the cause.

The picture has a limit. A neighbour can tell you the ladder will change. A provider may announce a change late, or not at all. Also, a ladder is one thing, and a provider is a service with many parts.

(SYNTHETIC / TRAINING ONLY: Daily List and every person named in this lesson are invented.)

PICTURE IT

The picture is the one the lesson above opens with. The table below shows how each part of it matches the software.

THE REAL JOB Testing the caller’s response when an outside service is slow, changed or uncertain.

  1. Sandbox first
  2. Time limit
  3. Check status
  4. Guard the door
Plan for the locked shed

HOW THE PICTURE MAPS

How each part of the picture matches the software
In the pictureIn the software
A borrowed ladderAn outside service
A practice ladder in the gardenThe provider sandbox
Giving up if the neighbour is outThe request timeout
Not going back to a locked shed for a whileThe circuit breaker

WHERE THIS PICTURE STOPS

  • A neighbour can warn you, but a provider may change without notice.
  • A ladder is one object, but a provider is a service with many parts.
  • You may not see provider internals, but you can inspect and repair your own caller.

HOOK

You do not own it; test your side.

REMEMBER IT THIS WAY

A rule of thumb: if you see this, think that.

If a service belongs to another company, usually test your own side: make the provider slow in a test copy and check what Lily sees.

What each part of the trick stands for
In the trickWhat it stands for
your own sideHe tests the app's side of each case
make it slowWhat if the billing service is slow

An unchanged fixture cannot show new provider behavior, so check fresh provider evidence too.

TELL A FRIEND

A borrowed ladder has an owner, but you still check your own use and the boundary.

OFTEN MIXED UP WITH Stand-ins for other systems: stubs and mocks. Stand-ins let you force cases without the real service. This lesson also keeps a few checks on the real one.

PRACTISE AND KEEP

Sources for this topic — 13 sources
  1. Market practice

    Timeouts, retries and backoff with jitter (Amazon Builders Library) ↗ — Amazon · Every call to another service needs a timeout, and retries should wait longer each time with some random delay (search excerpt, page not opened)

    Engineering article. Says set a timeout on every remote call, retry only where it is safe, wait longer between tries and add randomness. Search excerpt only. · Checked 2026-10-18

    Found through a web search; the page was not opened (search excerpt, page not opened). Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.

  2. Market practice

    Testing (Stripe documentation) ↗ — Stripe · Vendor page: test cards simulate outcomes such as declines, and test keys are used on every call when working with them (search excerpt, page not opened)

    Vendor page: test cards simulate declines and other outcomes, and test keys must be used on every call when using them. Practitioner guidance, not a standard. · Checked 2026-11-08

    Found through a web search; the page was not opened (search excerpt, page not opened). Version: Web page, no edition number. Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.

    8 November2026: primary StripeTesting introduction, HowToUseTestCards, DontUseRealCardDetails and TestCode read at current docs.stripe.com/testing destination. Use provider test values/test keys; not a full1280line catalogue or PCI audit.

  3. Market practice

    Circuit breaker design pattern (Wikipedia) ↗ — Wikipedia · A circuit breaker stops calls to a failing service for a while (search excerpt, page not opened)

    Describes a guard that stops calls to a failing service for a while. Practitioner guidance, not a standard. · Checked 2026-10-18

    Found through a web search; the page was not opened (search excerpt, page not opened). Version: Web page, no edition number. Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.

  4. Market practice

    RFC 9110 — HTTP Semantics ↗ — IETF · HTTP defines status codes such as 408 Request Timeout, 503 Service Unavailable and 504 Gateway Timeout, and a Retry-After header (search excerpt, page not opened)

    The definition of what an idempotent request method is, alongside safe methods, the status-code semantics an API contract is built on, and conditional requests.

    Used here for the systems-design questions a Payments Software Engineer and a Payments Solution Architect are asked, where the question turns on HTTP's own guarantees rather than on a scheme's rules. · Checked 2026-08-18

    Internet Standard, June 2022, obsoleting RFC 7230 through 7235.

    Cited for method semantics only. "Idempotent" in RFC 9110 is a property of a method: that repeating the request has the same intended effect on the origin server. It is not the same claim as "this payment cannot be duplicated", which is a scheme-level guarantee with its own documents.

    Read through a mirror, because the publisher's own domain could not be fetched (a reachability gap, not a statement about the publisher). A 403 there is a policy refusal and says nothing about whether the document exists or is reachable elsewhere.

    Anyone on an unrestricted network should open the canonical URL above and confirm the section and page numbers cited against it. Every claim drawn from this entry is written so that it can be checked against a numbered page.

    Read in full from the HTTP Working Group's own publication mirror at httpwg.github.io.

  5. Market practice

    Contract testing with Pact (Ensono Stacks documentation) ↗ — Ensono · Vendor guide: contract tests record what a caller expects from a provider, and a can-i-deploy check says if a version is safe to release (search excerpt, page not opened)

    Describes consumer-driven contract testing and the can-i-deploy check; a vendor guide. Practitioner guidance, not a standard. · Checked 2026-11-08

    Found through a web search; the page was not opened (search excerpt, page not opened). Version: Web page, no edition number. Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.

    8 November2026 bounded primary update: 8November2026 Ensono overview and CanIDeploy section opened. Template-specific scripts/examples; precise currentmatrix claims rely on separate Pact primarypage, not every SDK/version.

  6. Official requirement

    RFC 9110 — HTTP Semantics ↗ — IETF · RFC9110/STD97,June2022:9.1,9.2.1–9.2.2,13.1.2,15.5.2,15.5.4,15.5.6 and15.5.9; safe/idempotent intended effects,401challenge/403refusal,405Allow/501,304conditionalGET/HEAD versus412,408incomplete request (relevant primary passages opened6November2026).

    The definition of what an idempotent request method is, alongside safe methods, the status-code semantics an API contract is built on, and conditional requests.

    Used here for the systems-design questions a Payments Software Engineer and a Payments Solution Architect are asked, where the question turns on HTTP's own guarantees rather than on a scheme's rules. · Checked 2026-08-18

    Internet Standard, June 2022, obsoleting RFC 7230 through 7235.

    Cited for method semantics only. "Idempotent" in RFC 9110 is a property of a method: that repeating the request has the same intended effect on the origin server. It is not the same claim as "this payment cannot be duplicated", which is a scheme-level guarantee with its own documents.

    Read through a mirror, because the publisher's own domain could not be fetched (a reachability gap, not a statement about the publisher). A 403 there is a policy refusal and says nothing about whether the document exists or is reachable elsewhere.

    Anyone on an unrestricted network should open the canonical URL above and confirm the section and page numbers cited against it. Every claim drawn from this entry is written so that it can be checked against a numbered page.

    Read in full from the HTTP Working Group's own publication mirror at httpwg.github.io.

  7. Market practice

    How Pact works — consumer tests and provider verification ↗ — Pact Foundation · How Pact works: real consumer code against mock provider, generated contract, independent provider states and verification against actual provider; static replay cannot discover fresh provider changes (relevant primary passages opened6November2026).

    Actual consumer client against mock provider, pact generation, independent provider states and provider verification opened. Product guidance, not a universal testing standard. Original figure source bytes matched repositorye2072af34960cb19d6c132d370c2fd580ec0e55c under the documentation MIT notice. · Checked 2026-11-08

    Opened relevant primary passages on6November2026 via normal web search and document view. Actual consumer client against mock provider, pact generation, independent provider states and provider verification opened. Product guidance, not a universal testing standard. Original figure source bytes matched repositorye2072af34960cb19d6c132d370c2fd580ec0e55c under the documentation MIT notice.

    8 November 2026: actual HTTP interaction, Consumer Testing and Provider Verification sections through Putting It All Together opened, page footer 23 December 2024. Consumer checks and selected provider response verification are distinct; a written contract alone is not verification. No whole transport or deployed-behavior guarantee.

  8. Market practice

    Stripe API — Idempotent requests ↗ — Stripe · 8 November 2026: complete short primary Idempotent Requests reference read. API v1 saves first executed result, including 500; validation/concurrent conflicts before execution are not saved. Payload/key scope and pruning matter. API v2 may finish incomplete work and return updated responses; not universal ignore-copy semantics.

    Actual complete short reference reviewed. APIv1 saved result begins with execution, includes500results, parameter/retention/pruning semantics and unsaved validation/concurrency conflicts. APIv2 can resume incomplete work and return updated responses. Not identical-response semantics for every idempotent operation. · Checked 2026-11-06

    Actual primary page/document sections opened and compared in the Industry Contexts audit on 6 November 2026; scope and section-reading limits are documented in docs/research/v43-testing-industry-contexts-progress-20261106.md. Paraphrase teaching facts; a public page is not itself permission to republish proprietary source figures.

  9. Market practice

    Stripe Sandboxes ↗ — Stripe · 8 November 2026: complete short primary Stripe Sandboxes page read. Selected sandbox payments are not processed through card networks/providers or moved as real funds. This is provider-specific; credentials, settings, real data and other integrations still require control.

    Bounded provider-test environment or payment-data teaching evidence; no full provider or PCI DSS certification. · Checked 2026-11-08

    8 November 2026: complete short primary Stripe Sandboxes page read. Selected sandbox payments are not processed through card networks/providers or moved as real funds. This is provider-specific; credentials, settings, real data and other integrations still require control.

  10. Market practice

    Circuit Breaker pattern (Microsoft Azure Architecture Center) ↗ — Microsoft · 8 November 2026: bounded primary Context/Solution/state-machine and Problems/Considerations through recovery/concurrency/resource separation read. Configured closed/open/limited half-open roles; external operations repair the service. No repair, latency or backlog guarantee.

    Describes a circuit breaker as a state machine with closed, open and half-open states: a failure count opens it, an open breaker fails calls at once, and trial calls in the half-open state decide whether it closes again. Vendor documentation, not a standard. · Checked 2026-11-08

    Found through a web search; the page was not opened (search excerpt, page not opened). Version: Web page, no edition number. Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail. Supplement6November2026: actual Azure Architecture Center pattern and state figure opened; four threshold/timer/failure/success transitions. Guidance, not a universal standard.

    8 November 2026: bounded primary Context/Solution/state-machine and Problems/Considerations through recovery/concurrency/resource separation read. Configured closed/open/limited half-open roles; external operations repair the service. No repair, latency or backlog guarantee.

  11. Market practice

    RFC 9110 — HTTP Semantics ↗ — IETF · RFC9110/STD97, June2022, section10.2.3 actually opened 8 November2026: Retry-After may be an HTTP-date or nonnegative integer delay-seconds. No universal retry authorisation or whole-standard reread claim.

    The definition of what an idempotent request method is, alongside safe methods, the status-code semantics an API contract is built on, and conditional requests.

    Used here for the systems-design questions a Payments Software Engineer and a Payments Solution Architect are asked, where the question turns on HTTP's own guarantees rather than on a scheme's rules. · Checked 2026-08-18

    Internet Standard, June 2022, obsoleting RFC 7230 through 7235.

    Cited for method semantics only. "Idempotent" in RFC 9110 is a property of a method: that repeating the request has the same intended effect on the origin server. It is not the same claim as "this payment cannot be duplicated", which is a scheme-level guarantee with its own documents.

    Read through a mirror, because the publisher's own domain could not be fetched (a reachability gap, not a statement about the publisher). A 403 there is a policy refusal and says nothing about whether the document exists or is reachable elsewhere.

    Anyone on an unrestricted network should open the canonical URL above and confirm the section and page numbers cited against it. Every claim drawn from this entry is written so that it can be checked against a numbered page.

    Read in full from the HTTP Working Group's own publication mirror at httpwg.github.io.

  12. Market practice

    Additional HyperText Transfer Protocol (HTTP) status codes (Request for Comments 6585) ↗ — IETF · RFC6585, April2012, Standards Track; complete section4/429 read 8 November2026. Rate-limit response MAY contain Retry-After; user identity and counting policy are not fixed. Not an all-HTTP-error retry rule.

    Per the search excerpt, defines 429 Too Many Requests for rate limiting; a response may include a Retry-After header; the response must not be stored by a cache. · Checked 2026-11-08

    Found through a web search; the page was not opened (search excerpt, page not opened). Version: Web page, no edition number. Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.

    RFC6585, April2012, Standards Track; complete section4/429 read 8 November2026. Rate-limit response MAY contain Retry-After; user identity and counting policy are not fixed. Not an all-HTTP-error retry rule.

  13. Market practice

    Timeouts, retries, and backoff with jitter: original publisher PDF ↗ — Amazon Web Services · Original AWS retry PDF, Retries/Backoff/Jitter sections read earlier in this same8November2026 workflow; SHA2564d01d9878e0521a8a839d1043df9f4a2b28ef383e1978d2915507cbd9c0d8e32. Capped/random waits, budgets and ambiguous remote effects; redirected summary is not original evidence.

    Bounded retry engineering evidence for the selected Background Jobs and Third-Party Connections lessons; service-specific conditions, not a guarantee of business completion. · Checked 2026-11-08

    8 November 2026: original publisher PDF Retries and backoff/Jitter sections read, SHA256 4d01d9878e0521a8a839d1043df9f4a2b28ef383e1978d2915507cbd9c0d8e32. Capped waits, bounded retries, jitter and side-effect uncertainty. Redirected web summary is not used as original text.

Deepest material on this page: L4 — Standards & sources. Where a topic stops short of implementation depth, that is a deliberate coverage decision, not an oversight — see coverage.