I think I see what you're after -- if we're manually forcing the last test id, then we clearly don't need to ask the database about it now or in the future. Is this right?

I think a clarifying comment here -- possibly mentioning the comments for _setup_pipe() -- would be helpful.