Thermal shock of ceramic matrix composites