Fuel pump

What would cause a fuel pump to work intermittintly?(brand new pump)

Poor connection, bad wiring, faulty pump, faulty relay.

Great thanks. update mechanic just called wiring harness from relay to pump has bad corrosion and when wiggled the pump would work. changing the wiring harness in the am.