These 2 functions assume only one process was profiled. It may not be the case due to several problems - one of them being cleanup errors of previous tests. It's best if tests are more robust and manage to handle the "dirty" environment as well.
See sample case here. Due to #513, a ruby process leaks. Subsequent Ruby tests that use the snapshot_one_* fail with this assert > assert len(result) == 1, result because now there are 2 processes profiled (so 2 results).
Use the matching snapshot_pid_profile.