DEV: Improve tag groups test (PR #12848)

This PR should stop this test case from failing randomly.

GitHub