tests: fix DEBUG=attach functionality