Reduce code duplication in tests.

1 job for 1477-get-client-minor-version in 11 minutes and 23 seconds (queued for 3 seconds)