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

Exponential Increase in case ids when using close_plan via rest api


#1

We observe since a while the heavily growth of the Case ID. After analyzing the logs we figured out that mainly rest calls with close_plan in this time where executed. A manual close plan via ui does not create such a increase within the id but doing the same via rest does. As an example, we tried to close a plan which included 7tests and the id increased his value by 44. In our prod environment we have in general plans with around 500+ tests which are running automated and getting closed afterwards. Is this a known issue or did someone else observed something similar?

Best Steffen


#2

Hi Steffen,

Thanks for your posting. The underlying behavior from TestRail is the same whether you close a test plan via the UI or the API. It’s normal that the case IDs increase over time and closing a test plan will archive the tests in the runs/plan which creates internal case copies (so that changes in the case won’t propagate to the closed runs).

I hope this helps!

Cheers,
Tobias


#3

Hi!

It’s ok to create copy of cases from test plan/run which is closed. But why a plan/run closing leads to creation of copies of all cases from the project? For examle I close a run which includes only 10 cases, but in DB the cases table grows up for 12000 rows.
Is it a bug? Whether the table can be somehow cleaned?

We use TestRail 5.3.0.3603


#4

Hi Sergey,

Thanks for your reply! The test cases are duplicated in the background when closing a test run/plan to create an immutable version of the test case (so that changes/moves/deletes to a test case don’t affect the history of the test when it was run on any specific run/plan). This would store these in the database and increase the IDs as needed, and this is the standard behavior of TestRail. TestRail would just require that the IDs be unique in the database.

TestRail’s database was designed to scale well, and please note that you should never directly write to or change anything in TestRail’s database. This would break the consistency of the database, even small changes you might find unproblematic, and your TestRail instance would be immediately unsupported. You wouldn’t be able to upgrade anymore and we wouldn’t be able to support the instance anymore. So you shouldn’t attempt to clean the table directly in the database. The only method to clear this would be to delete the closed/archived runs/plans directly via the UI, however this is only recommend if you actually want to remove the history of the full test run/plan indefinitely (as this cannot be undone).

Hope this helps!

Regards,
Marco


#5

Hello, Marco!
Thanks for your answer, but it does not help. I still can’t understand why TestRail makes copy of 12000 cases just to save information about several cases included in closing plan/run?