The Bluebirds head coach watched his team twice throw away the lead after going a goal down before Joel Bagan struck a dramatic 98th minute winner.
It looked as though Cardiff might not even escape with a draw as they came under heavy pressure late in the second-half when they were level at 3-3.
But even though Barry-Murphy’s team may be lacking in experience, they are not short of fighting spirit as they rallied in injury time to snatch a winner.
“Every test in this league is different,” said a breathless Barry-Murphy.
“In the second half, we looked as if we lost our composure and we were very frantic in the way we played the game.
“But at the end, Cian Ashford showed the type of composure that we want and had a real quality action.
“Then, Joe Bagan showed the aggressive intent that we wanted to be in that position to score a goal so late and send the stadium wild."
It was Bagan’s first goal for three years.
Omari Kellyman, Ashford and Yousef Salech had all scored for Cardiff before defender Bagan proved the unlikely hero with his first goal since netting three in three games in 2022.
The victory was Cardiff’s fifth in succession, their best sequence since they managed six on the trot four-and-a-half years ago under former manager Mick McCarthy.
That may be another feather in the cap for Barry-Murphy, but more significantly the win keeps Cardiff four points ahead of second-placed Bradford City and six ahead of the clubs in the play-off places.
It was not one of their more convincing displays as Doncaster - who had only won once in their previous 12 league matches - were allowed to seize control after they made it 3-3 through Harry Clifton with almost 20 minutes remaining.
Rovers carved out further chances, but Cardiff keeper Nathan Trott kept his team in it before Bagan snatched a winner.
It came after the impressive Ashford cut in from the right and aimed a low shot for the far corner.
Doncaster keeper Thimothee-Lo-Tutala - who had looked shaky on more than one occasion - could only palm the ball into the path of Bagan, who reacted sharply to turn the ball home.
“The most pleasing thing is that we found a way to win and create enough chances to do that,” added Barry-Murphy.
“I'm very pleased for the players and the supporters that we managed to win through.
“I think if I speak too much about what we perceive as failings in the game, it would discredit Doncaster as they play the game very well and are so dangerous in the way that they play.
“We knew that beforehand, but our performance numbers just weren't at the level that we would want.
“But there's a whole lot of reasons for that, and the most important thing is that we found a way to win, and we did.
"I thought Cian carried us at times today where we were in need of real quality and when the game wasn't perfect he was the one who had real quality.
"So I'm very pleased with him and all those players who can contribute have to because it's important that we don't rely on one or two players too much."
Doncaster had taken a 15th minute lead through captain Owen Bailey, whose mis-hit shot through a crowd of players took a enough of a deflection to wrong-foot Trott.
Cardiff responded when Kellyman calmly brought down a cross from Isaac Davies and in one graceful movement, hammered the ball into the roof of the net.
When Ashford turned sharply and ran 30 yards before sliding the ball home as he fell, it looked as though Cardiff would seize control with a 2-1 lead to build on.
But Wales youngster Charlie Crew hit a superb pass to pick out Doncaster striker Brandon Hanlan, who drew Trott and then fired past him.
It stayed 2-2 until half-time when Barry-Murphy made a number of changes that initially seemed as though they would re-assert Cardiff’s control.
A curling cross by Ryan Wintle in the direction of Salech enabled the Danish hit man to impressively stretch beyond defender and turn the ball past the goalkeeper.
Leading 3-2 with half an hour still to play, Barry-Murphy must have felt Cardiff could score again to give themselves a cushion to lean on.
Instead, the weaknesses in Cardiff’s defence were exposed again when Clifton chested down a header from Bailey and struck another leveller past Trott.
The Bluebirds keeper produced a fine save to deny Doncaster substitute Jordan Gibson, before Bagan struck at the other end to underline Cardiff’s resilience.
Doncaster manager Grant McCann felt his team deserved a draw and wondered how seven minutes of additional time had turned into eight-and-a-half.
"Nobody wants to concede in the 98th minute of a game," said McCann.
"We did more than enough to come away with at least a point. I felt we created the better chances in the game and we should have scored more than three goals.
"But I still gave my players huge credit in the changing room. It’s difficult to stand there and be really negative or reactionary to that performance. I’ll need to have a good look back at it.
"The league is still young with 26 games to go. I don’t take much notice of form at this point. I was pleased with how my players went about the game and with their performance.
"We could have come here and sat behind the ball and frustrated them, but we went toe to toe with a team that has a budget that is six times higher than ours.
"For large spells I thought we were the better team.
"We had enough chances to score more goals than we did, although I was pleased with the three we did score. I’m just really frustrated with the way it happened at the end.
"We didn’t come here to bow down to Cardiff. I prefer my teams to be positive and play on the front foot.
"We should have scored before we got the first goal and all through the game there were a lot of chances that we should have taken. I don’t know where the referee got an extra minute and a half from on top of the seven."






