Preventing Azure Pipelines Build Pipeline Failures

Prevent Build Pipeline Failures in Azure Pipelines

Question

You have a build pipeline in Azure Pipelines that occasionally fails.

You discover that a test measuring the response time of an API endpoint causes the failures.

You need to prevent the build pipeline from failing due to the test.

Which two actions should you perform? Each correct answer presents part of the solution.

NOTE: Each correct selection is worth one point.

Answers

Explanations

Click on the arrows to vote for the correct answer

A. B. C. D. E.

BD

D: You can mark or unmark a test as flaky based on analysis or context, by choosing Flaky.

To configure flaky test management, choose Project settings, and select Test management in the Pipelines section.

B:

Slide the On/Off button to On.

https://docs.microsoft.com/en-us/azure/devops/pipelines/test/flaky-test-management

The correct actions to prevent a build pipeline in Azure Pipelines from failing due to a test measuring the response time of an API endpoint are:

A. Set Flaky test detection to Off: This action disables the flaky test detection feature in Azure Pipelines, which marks tests that have inconsistent results as flaky. By turning off this feature, the build pipeline will not fail due to a flaky test.

B. Clear Flaky tests included in test pass percentage: This action removes the flaky tests from the overall test pass percentage calculation. As a result, a failed test that is marked as flaky will not affect the overall test pass percentage and cause the build pipeline to fail.

Therefore, options A and B are the correct actions to perform to prevent the build pipeline from failing due to the test measuring the response time of an API endpoint.

Option C, Enable Test Impact Analysis (TIA), is not relevant to this scenario. TIA is a feature in Azure Pipelines that helps to identify which tests are impacted by code changes, so that only affected tests are run during a build pipeline. It does not prevent the build pipeline from failing due to a flaky test.

Option D, Manually mark the test as flaky, is not a recommended solution as it does not address the root cause of the problem. Manually marking a test as flaky may cause it to be ignored, but it also means that the test is not providing reliable feedback on the health of the application.

Option E, Enable test slicing, is not relevant to this scenario. Test slicing is a feature in Azure Pipelines that allows for parallelization of tests across multiple agents, which can reduce the time required to run a large number of tests. It does not prevent the build pipeline from failing due to a flaky test.