If this is about fixing macos failures, Vincent pointed out that there was a decision at some point to fix broken builds and not to workaround that in test code.
AFAICT this patch won't actually prevent failures, just skip later tests after the failure so they don't crash.