get() returned more than one TestCase -- it returned 2!
Recently we have been having issues with jobs having duplicated job
TestCases.
While job details page fails to load the results page is still accessible.
So far we could not find exact cause of this issue but it might be dispatcher hardware related.
However, this highlighted the issue with LAVA database use.
LAVA implicitly relies on uniqueness instead of using database contraints.
There was once a job that got two lava
TestSuites which broke internal logs upload endpoint.
Also get_or_create call requires unique constraints to avoid race conditions. I've investigated the current unique contraints and get_or_create calls and turns out that TestSuite does not have unique constraint on job+name even though it uses get_or_create.