This test simply failed because you missed,

    len(all_frames[index]) >= threshold

dont worry, the question was unclear so I didn't deduct points for this.