How sure are you that the problem is the relay? The most common problem for continuous running is loss of freon. Is the unit still under warranty? If so, just return.
Low refrigerant would cause continuous running only if the controller is demanding dehumidification. The compressor in my machine runs continuously independently of where the shutoff threshold is set, or even if the unit is turned off. The fan behaves itself: If I set the threshold below the room humidity, it will kick on, and if I set the threshold above the room humidity it turns off.
With the machine unplugged and the wires on the secondary terminals removed (hot from plug & output to compressor), I read zero ohms across the secondary pins.
With the machine plugged in, hot from plug reconnected to relay, and compressor wire still disconnected I get 120V at pin for the compressor, even when the machine is turned off.
If it was the controller forcing the relay closed under the wrong conditions, the relay still ought to release and read OL when the machine is unplugged.
She's long out of warranty, unfortunately.