skip teardown if cache has not been set up

otherwise test execution aborts at this place. occured on oracle

@DeepDiver1975 @icewind1991 please review and :+1: