-[🪄 Debug MR Test Failures with Duo](using-duo-to-debug-test-failures-in-mrs.md) - Use Duo to quickly diagnose and fix test failures in your MR
-[🪄 Debug MR Test Failures with Duo](using-duo-to-debug-test-failures.md#-using-duo-to-debug-and-fix-test-failures-in-your-merge-request) - Use Duo to quickly diagnose and fix test failures in your MR
-[🔥 Debug Live Environment Test Failures with Duo](using-duo-to-debug-test-failures.md#-using-duo-to-debug-live-environment-test-failures) - Use Duo to quickly diagnose and fix test failures in your MR
@@ -90,8 +90,8 @@ For teams requesting upgrade support (within or outside office hours):
NOTE! We don't have many team members in APAC area, so sometimes there will be an empty window of 4 hours during which we kindly ask you to use our troubleshooting guides:
-[Using Duo to debug test failures in MRs](/handbook/engineering/testing/using-duo-to-debug-test-failures-in-mrs/)
-[Guide to E2E test failure issues](/handbook/engineering/testing/guide-to-e2e-test-failure-issues/)
-[Using Duo to debug test failures](../testing/using-duo-to-debug-test-failures.md)
-[Guide to E2E test failure issues](../testing/guide-to-e2e-test-failure-issues.md)
title:Debug Test Failures in Merge Requests with Duo
description:Concise guide to using Duo to diagnose and suggest fixes for test failures in a merge request.
title:Debug Test Failures and Live Issues with Duo
description:Concise guide to using Duo to diagnose and fix test failures in MRs and live environment E2E test pipelines.
---
GitLab Duo can help you quickly diagnose and resolve test failures in two key scenarios:
-**[Debug MR Test Failures](#-using-duo-to-debug-and-fix-test-failures-in-your-merge-request)** - Determine if failures are related to your changes and get suggested fixes
-**[Debug Live Environment Failures](#-using-duo-to-debug-live-environment-test-failures)** - Diagnose issues in staging, canary, and production monitoring pipelines
---
## 🪄 Using Duo to Debug and Fix Test Failures in Your Merge Request
@@ -47,7 +54,7 @@ When your merge request has a failing test, use Duo to quickly determine if it's
- Always review suggestions carefully before applying them
- Test the fix locally if possible before committing
## ⚠️ When Duo Can't Help
### ⚠️ When Duo Can't Help
If Duo's analysis does not resolve your issue, follow these steps in order:
@@ -57,13 +64,103 @@ If Duo's analysis does not resolve your issue, follow these steps in order:
2.**💻 Try reproducing locally** (~10 minutes):
- Execute the test against your GDK to confirm if it's environment-specific or a genuine issue
3.**🚧 Request quarantine if needed**:
- If the failure is blocking `master` and is unrelated to your changes, consider the [Test Quarantine Process](./quarantine-process.md)
- If the failure is blocking `master` and is unrelated to your changes, consider the [Test Quarantine Process](quarantine-process.md)
---
## 🔥 Using Duo to Debug Live Environment Test Failures
When automated E2E tests fail in staging or production pipelines, use Duo to quickly diagnose whether it's an environmental issue, bug or a test problem.
> **✨ Note:** GitLab Duo is available on the ops instance (ops.gitlab.net) and can be used directly in job logs there.
>
> **⚠️ Critical: Staging-Canary Impact**
> Smoke test failures (`qa-smoke` jobs) in the [staging-canary pipeline](https://ops.gitlab.net/gitlab-org/quality/staging-canary/-/pipelines) **block deployments to production**. When debugging these failures, prioritize determining whether the issue is a genuine application problem or a test issue that can be safely quarantined.
1.**Navigate to the failing pipeline** on ops.gitlab.net:
2.**Open the failing job** that displays the test failure
3.**Invoke GitLab Duo** in the job log view (press `d` or click the Duo button in the top right corner)
> **📝 Note:** Duo will automatically truncate lengthy job logs by removing the middle section. For greater accuracy, you can copy and paste the specific stack trace and error message into your prompt.
>
> **🌐 For browser-based tests:** Duo cannot download artifacts automatically. If needed, you can manually download the DOM from the `failure_screenshots` directory or relevant artifacts in the job and paste it into your prompt to help Duo debug browser-based failures.
4.**Clear previous context** to avoid confusion with other investigations:
```text
/clear
```
5.**Prompt: Analyze the failure:**
```text
Analyze this test failure in [staging-canary/staging/canary/production]:
**Context:** Tests are automatically retried within a job. If a test passed on that automatic retry, ignore it completely.
1. **Check automatic retry status first** - Look for retry sections in the log. **Do not mention any tests that passed on automatic retry** - we only care about tests that failed both attempts within the job.
2. For persistent failures (failed both the initial attempt AND the automatic retry):
- What failed and why? (error type, correlation IDs, specific error messages like 404s)
-[Detailed Quarantine Process](./quarantine-process.md)) - How to quarantine tests
-[Test Quarantine Process](quarantine-process.md) - How to quarantine tests
-[Guide to E2E Test Failure Issues](guide-to-e2e-test-failure-issues.md) - Product engineer debugging guide
**Need help?** Reach out in [**#s_developer_experience**](https://gitlab.enterprise.slack.com/archives/C07TWBRER7H) or create a [Request for Help issue](https://gitlab.com/gitlab-org/quality/test-governance/request-for-help/-/issues/new)