TestProject Forum

Error 412 HTTP issue

After developping an addon that allows us to re-run failed tests.For this reason : we have used testProject API to GET the report and check it and then modify the resource (which is our test) with a POST endPoint (to run the test).

Locally (in My IDE) everything works fine and the test is re-Runned, but after integrating the addon in testProject i have a 412 HTTP error after the axecution of the POST request. (the GET requst and the code works fine in testProject, after printing some variable values).
I suppose that there is a parameter in my header that shoudl be added to avoid this 412 HTTP error, Can you PLEASE help us to add the right parameter to the header of POST Request?

Thanks for your help !

HI @hpartouche-ext

This happens because when the addon is running within your test and the Agent is executing it, sending the request to the API results n error code 412, as the Agent is busy executing.

queue (optional): If true and the agent is currently busy, the test will be executed once the agent becomes available.

Try adding the queue parameter as true to your API call, so that the failed test will be queued and executed after the addon execution is complete.

2 Likes

Hi, this functionality will be added soon (out of the box) as part of the job settings you will be able to define if you want to heal the test by running it once again if it has been failed.
in the reports these tests will be marked as flaky but passed.

1 Like

Hi all,
This is the functionality issue number: TP-15639 (Re-run failed tests again inside a job)
We will post it here once it’s completed.

1 Like

Great News ! Thanks Mark.

So if my test failed what will be re run ? The test or the job?

if one of the tests in a job will fail, this specific test will be re-run again. the definition of this configuration will be on the job level for all tests (true/false)

Hello Marat,

Thanks again pour your help.

We have try but still ko on our side

Dear all,

its ok now ! we just modify the agent ID, and now its work perfecly!

Thanks again for your help

1 Like

Hi,
This option is now available check release notes for 3.3.0:
v3.3.0 - TestProject Documentation