Use a counter to ensure each tempDir call gets a unique directory name, preventing collisions when tests run within the same millisecond.