In-situ stress monitoring during corrosion and electrodeposition