Test mass charging from cosmic rays