The test pressure is set by the code. Under the Pressure Equipment Directive and EN 13480-5 the hydrostatic test pressure is the greater of two values: 1.25 times the maximum allowable pressure, scaled by the ratio of material strength at test and design temperature, or 1.43 times the maximum allowable pressure.
ASME B31.3 requires not less than 1.5 times the design pressure, likewise corrected by the ratio of allowable stresses. In both cases no component in the test section may be overloaded by the test pressure. Expansion joints, valves and instruments have limits of their own and are removed or isolated where necessary.