search cancel

Unable to delete multiple tests "Bad Request: Test is currently running" in BlazeMeter

book

Article ID: 215049

calendar_today

Updated On:

Products

BlazeMeter

Issue/Introduction

We are trying to delete some older unused tests but receive "Could not delete test: Bad Request: Test is currently running" error both in the UI and when trying the API call. Could you please take a look and let us know how to delete these tests? 

Cause

Even though the tests in question are not currently running, there are some zombie sessions associated with the tests in the background that are stuck in the CREATE status. Apparently, this was a common and known issue in BlazeMeter v3.

Environment

Release : v4

Component : BLAZEMETER PERFORMANCE TESTING

Resolution

Before you can delete a test, there must not be any active (CREATE) sessions associated with the test. You will need to find any/all the active "zombie" sessions for the test in question, and terminate the sessions. Once the sessions have been ENDED, you can delete the test.

  1. To find the active sessions is to use the following API call: https://a.blazemeter.com/api/v4/sessions?workspaceId=<workspaceID>&active=true&limit=200

    For example, https://a.blazemeter.com/api/v4/sessions?workspaceId=123456&active=true&limit=200 will return the first 200 active sessions in Workspace 123456.
  2. Search the results for any active sessions, by Test Name or by Test ID, for the test you wish to remove.

  3. Record the active session IDs for each test, such as 'r-v3-5cc770df8ee30', and use the following API to terminate each of the sessions: https://a.blazemeter.com/api/v4/sessions/<sessionID>/terminate

    For example, https://a.blazemeter.com/api/v4/sessions/r-v3-5cc770df8ee30/terminate

  4. Once all the sessions have been terminated, you can delete the tests.