[Test] Implement custom ratio check for advanced search
[Test] Improve stability