Stress effects in thermal cycling of copper (magnesium) thin films