SPARK-3415: modified test class name and call cloudpickle.dumps instead using StringIO