Check all the connections to do with the light wiring. Separate each connection and give them a clean with contact cleaner. With the lights on wiggle each connector and see if the light flickers. Inspect where the wire joins the metal connectors also as the wires can crack and fail here. you can use a multimeter set to read Ohms to check the continuity of each wire to check for breaks internally. This should give you an idea where the problem may be. Dont forget to check the switch also.