testscript: background cmds break -coverprofile
testscript tries to merge coverage profiles, but this is broken with background commands. It seems like the reason is that testscript expects the background cmd to write its coverage file immediately, not at the end of the test once it's interrupted.
I am running into this issue at the moment as well: go test ./... -coverprofile=cov.out is causing command <cmd> failed to generate coverage information . Is this something that could be changed, or is unlikely to change?
Edit: After digging into mine some more, it looks like this only happens on an expected command failure ! <command>. I don't believe this is an issue nor is it related to this.
I'm pretty sure this could be fixed, it just requires someone to refactor the code a bit to allow adding coverage info when background processes are cleaned up. Perhaps @rogpeppe has thoughts, since he wrote a lot of this code coverage merging logic.