fix and tune query latency tests