Skip to content
TestLine Menu
TestLine
QA process

A hotfix in production: how to test an urgent fix quickly and safely

A step-by-step test plan for an urgent fix, what not to skip even under time pressure, and what to do after release so the same bug doesn't come back.

author
Artur Machowski, Senior QA Engineer
published
reading
5 min

Short answer

You test an urgent fix in 30-60 minutes following a fixed plan: reproduce the bug, check the fix, add a regression test for that bug, run the automated smoke test of the critical paths and have a rollback plan ready. After release, watch errors and metrics, confirm with the reporter that it works, and do a short review of why the tests didn’t catch it. If the bug came with the latest release and the fix isn’t obvious, rolling back is often faster and safer.

Hotfix test plan

stepwhat to dotime
1. reproducereproduce the bug on staging or a copy of the data, before the fix is written10-20 min
2. fixcheck the failing scenario and 2-3 variants next to it, e.g. different data, a different role10-15 min
3. regression testadd an automated test that catches this bug if it comes backtogether with the fix
4. smokeautomated smoke test of the critical paths in CIa few minutes
5. rollback planit’s clear who rolls back the change, and how, if something goes wrongbefore release
6. watcherrors, logs, business metrics after release30-60 min

Without step 1 you don’t know whether the fix addresses the right problem. Without step 3 the same bug returns with the next change.

Hotfix or rollback

situationbetter option
bug from the latest release, rollback doesn’t break dataroll back
the fix is one obvious linehotfix
the release included a database migration that can’t be undonehotfix
the bug existed for a long time and only surfaced nowhotfix
the cause is unknownroll back if possible and look for the cause without pressure

What not to skip under time pressure

  • the CI pipeline: a hotfix without tests is the most common cause of the next hotfix;
  • code review: even 5 minutes from a second person;
  • making sure the fix reaches the main branch: otherwise the bug returns in the next release;
  • communication: the customer support team knows the problem is fixed.

After the hotfix: a short review

Within 2-3 days of release, answer three questions, without looking for someone to blame:

  1. Why did the bug get through testing?
  2. Which test or process change will catch it next time?
  3. Do similar places in the app have the same problem?

If hotfixes happen more than once a month, it’s worth looking wider. The list of practices is in how to reduce bugs in production, and the share of releases that needed a fix is one of the quality metrics worth tracking.

How I can help

As part of QA support I test urgent fixes in your team and set up a fixed hotfix test plan with you, and as part of test automation I build a smoke test that runs in minutes. Describe your situation in the contact form.

Frequently asked questions

How much time should hotfix testing take?

Usually 30-60 minutes: reproducing the bug, checking the fix, a regression test for that bug and an automated smoke test of the critical paths. A full regression is usually not needed for an urgent fix if the smoke test runs in CI.

Does a hotfix need testing if it's urgent?

Yes. Haste is the most common cause of a hotfix for the hotfix. A short test plan agreed in advance takes less time than releasing the fix a second time.

When should you roll back instead of shipping a hotfix?

When the bug appeared in the latest release, a rollback is possible without losing data and the fix isn't obvious. A rollback usually takes a few minutes and is safer than a fix written under pressure.

What should you do after releasing a hotfix?

Watch errors and metrics for a few dozen minutes, confirm with the person who reported the problem that it works, merge the fix into the main branch and do a short review: why didn't the tests catch it.

Can a hotfix skip the CI pipeline?

It shouldn't. If the pipeline is too slow for urgent fixes, the answer is a fast smoke test, not skipping tests. A hotfix without CI is a common source of the next outage.

Got a release in a few weeks?

Describe your project in the form. I'll reply with questions about scope or an initial test plan.