Make test_search more robust