def METHOD_NAME():
    class Fcn:
        n = 0
        def __call__(self, x):
            self.n += 1
            return x**2 + 1e-2 * (self.n % 3)
    r = minimize(Fcn(), [1], options={"maxfun": 100000000})
    assert not r.success
    assert "Estimated distance to minimum too large" in r.message