fixes #3885 - sort IDs in test to prevent random failures