You don't even need the process, it's just a leftover from a test case.
The bug also occurs if only switch-to-buffer is called, but this code
must be run from the dedicated frame to get the unwanted raising
effect of the other frame:

(run-with-timer
   3 nil
   (lambda ()
     (switch-to-buffer "*test*")))