range tests: allow any range length that hits stop (#20532)
This test was occasionally failing (~1 in 10 million times) since
there are cases where the length of such a range is ambiguous, i.e.
there is more than one `n` such that `start + (n-1)*step == stop`.
This adjusts the test to allow any such choice of range length.