Optimal sequential testing for an inverse Gaussian process