How can I make sure IntelliJ's debugger attaches to the right process?

> I’m trying to debug the unit tests in my main project in IntelliJ by right-clicking the file and choosing debug. 

When running unit tests via the IDE, the build isn’t involved. I don’t understand what you’re actually doing here.