Tests for BZ-1022910 (postgresql and HT task instance retrieval)