Commercial jet engines -- by design -- can ingest massive amounts of water and still function normally.
The QF32 firefighters tried to stop engine #1 by flooding it with water but were unsuccessful. They then switched to foam, and the engine stopped after that rather quickly.
Once an engine is contaminated with foam, it has to be totally stripped down and completely overhauled.