It is filling with water, making ice, then dumping; so it is working. The water valve would not let it fill if it was bad or clogged. The timing is a problem. Perhaps it is not sensing the freeze and is dumping on the defrost cycle timer. Check and see if there is a sensor problem.