Depends. In newly born boys, there is projectile vomitting.. And it must be quickly treated. In adults, same signs and xrays can define the problem.
Ultrasound? Most common test for pyloric stenosis today is ultrasound that shows thickened elongated pyloric muscle. Standard measurements of muscle thickness are well known. 4mm thickness and greater than 1.4 cm in length. A upper gastrointestinal barium study performed in fluoroscopy predated ultrasound and also was quite accurate but involves ionizing radiation.