Not long at all (perhaps less than 10 dives/hrs), but even comfortable is only at the "Conscious Competence"
level of learning. That likely doesn't leave sufficient bandwidth to handle any additional issues that arise.
You will probably step back a couple learning levels on cave specific things when starting a cave class. You need your CCR abilities at the top-tier Unconscious Competence level to allow attention to those cave-specific tasks.
IMHO, if you are OC cave, then 50 hrs/dives before cave CCR might be OK. If no cave experience, likely 50 hrs on the loop is woefully short for CCR cave. Again, just an opinion.