Skip to main content

Fix Mock Misses

A mock miss means the service under test sent an outbound request that no recorded mock could answer. The usual cause is a value that changes on every run, such as a UUID in the URL, a timestamp in the body or a trace header, so the replayed request's signature never matches the recording. The Mock fixes section of a replay report lists those misses, groups them by the fix that would make them match, and writes the fix to the snapshot for you.

Where to find it​

Open a report from a replay that mocked its dependencies and select the Mocked Responses tab. The Mock fixes section sits below the mock accuracy by host. A report from a replay that mocked nothing shows a short note instead, and so does one whose responder ran in low data mode, because it kept none of the outbound calls. Reports analyzed before Mock fixes existed show nothing; re-run the replay to get the section.

Read the analysis​

The header shows two match rates over the same outbound requests. The first is the rate this replay scored. The second is the projected rate: what the replay would score with the fixes the snapshot already had, using the same matching the responder runs. Requests a chaos rule perturbed and connection handshakes the responder answered itself are left out of both.

Below the header, the misses are grouped by the fix that would make them match, most impact first. Each group names its endpoints, such as POST /v1/track/{UUID}, and how many misses it covers. Each recommendation in a group names the field it changes, the transform it writes and how many requests it touches. When a fix would make requests that already matched share a recording that answers differently, the recommendation says how many. Select Show requests to see each miss next to its closest recording, with every key that differs between the replayed and the recorded value.

Some recommendations are marked Needs judgment. A lookup key picks which recorded answer comes back, so masking it would return the wrong answer; map each value to its recorded one instead. A value no recording carries cannot be fixed by a transform; record that code path again.

Apply fixes​

Select Apply on a recommendation to write its responder transform to the snapshot. Apply all writes every recommended fix except the ones that need judgment, which it lists as skipped. Each fix is scoped by a filter to its group's endpoints, so it does not change how other requests match. Applying a fix again replaces the earlier one for the same field and scope.

The report shows the snapshot as it was when the replay ran, so its rates do not change when you apply a fix. A fix applied since the replay is marked "Applied. Re-run the replay to measure it." Apply all and re-run applies the fixes and opens the replay wizard with this run's settings, so the next report measures them.

Undo a fix​

The Applied fixes list shows every fix in the snapshot's responder transforms. Select Undo to remove a fix in every scope it was written for.

Work with proxymock web​

The dashboard and proxymock web run the same analysis, so they show the same groups, projected rate and Apply all set for the same traffic. Each fix is a responder transform tagged with the fix's id, so a fix made on one side is recognized on the other. Pull the snapshot with proxymock and a fix applied in the dashboard shows as applied in proxymock web's Mocks view, where Undo removes it. Push a workspace and a fix accepted in proxymock web shows in the dashboard's Applied fixes list.

Loading search...