It depends. In my case, there are certain spots that I know that if I pass a bus and go all out because of the traffic patterns, lights, and stop distribution, I'll lose him and won't see him again. Other spots, if I pass him, we're going to be leapfrogging for a mile or more. In those cases, I use an alternate route whenever possible (if that means moving one block over to a less trafficked road or taking a different route that's a bit longer or shorter than I'd planned) because I hate breathing in bus exhuast when I'm behind him and I've personally seen what happens when a bus and a bike collide (here's a hint the cyclist never wins). On pass or two back and forth is ok, after that I'm finding a different route or biding my time until he turns off.
__________________
Bikes: 1996 Eddy Merckx Titanium EX, 1989/90 Colnago Super(issimo?) Piu(?), 1990 Concorde Aquila(hit by car while riding), others in build queue "when I get the time"