RF-13706: Added a test for the removal of stale entries, and fixed the problem that QUnitTest executed each test multiple times