The test may wipe the wrong buffer if :bdelete switches to another one. Also remove the builtin TermClose autocommand. It doesn't affect the tests for now, but still it's better to avoid its interference.
src/gen/