My son had a sleep study at about 9 months. They had me do my regular bedtime routine with him and then stay in the room. In fact, I needed to stay in the room, because the bed they wanted him to sleep on was really high (like a hospital bed all the way up so they could work on him easily, attaching leads etc . . . ) and it was a bed, not a crib. So, I couldn't actually sleep because I was convinced he would roll off. And he did. But I caught him!
Ours actually wasn't all night. At around 2:00 a.m. they came in and said that we could go home or just sleep there. If he had been in a crib or even a bed where I felt I could climb in with him, I might have considered staying. Instead we left without hesitation.