Subscribe Join 180,000+ subscribers and receive articles from our blog about software quality, testing, QA and security. Subscribe

'tests' table growing exponentially


We are seeing an alarming growth in record entries in the “tests” table from test automation in relation to the “cases” or “runs” table. This is a concern because the tests table is now taking up close to 75% of used capacity.

Our tests table has grown to about 50 GB, while cases and runs are about 3GB and 100MB respectively.

Further querying shows we have more than 500M rows in the tests table, with only 150k runs.

We discovered that the root cause for this is due to TestRail adding records for all untested, AND unselected test cases in test runs with over 5k test cases.

Initially we suspected human error during manual entry but turns out the runs created by automation were driving most of the numbers.

We confirmed that the add_plan_entry API call used is setting the “include_all” boolean to false, and that even if the “include_all” flag is set to true, on the UI, it should show the unintended unselected test cases as “untested”, but on the UI it is not shown. In the database, these entries have “is_selected” set to false.

What is the best practice to mitigate this? And how can we remove the unused test records for these runs?

Note: the runs are a mix of completed and uncompleted state.

We also tested the APIs again by creating a “test” test run, and do not observe the behavior where unselected test cases had records added to the test tables.

Can we get clarification on how and when TestRail adds entries to the tests table?

Your help is greatly appreciated!