So a few weeks ago yet again I was too cheap to spring for an proper bike light from a bike store and opted to get this unit from the two dollar shop. Soon I found out that as I rode in the dark I had no tail light.
The design fault here is that when you go over a hump it jars the unit, and the battery disconnects for a split second, turning the unit off -- or at least that's my theory.
The solution was to solder a capacitor across the battery terminals. The capacitor provides power for that brief moment as the batteries disconnect and spring back into position. It appears to do the trick.
The capacitor was salvaged from a power supply that I picked up for a dollar at The Bower. I don't remember the value, but possibly 200uF 10V, the usual power filter cap.