Marshall, Steve wrote:
  
Any thoughts on how to confirm or deny Theory A?
    
Alvaro Herrera wrote:
Try changing the 1000 to NMPWAIT_WAIT_FOREVER
  
I'd tried Alvaro suggestion and it fixed the problem in my test case.  With the original code, the test would consistantly drop one of the events from pg_listener within a few seconds.  With the changed timeout, I've run it for about 10 minutes, or 100,000 notifications of each event, and it worked without error.

Are there any side effects from effectively disabling this timeout that should be tested?