Here, we report our recent progress in the design, fluid thermodynamics simulation, and high-power test of the2nd harmonic cavity for the China Spallation Neutron Source Phase II. A high-performance and large-size magnetic alloy (MA) core was developed as the load material for the radiofrequency cavity to achieve a high gradient of 40 kV/m. The water-cooling structure and cooling efficiency were studied and improved through numerical analysis and thermal experiments. The long-term stability of the cavity, especially the waterproofness of the MA cores with high heat load, was verified by high power tests.