kou commented on code in PR #43601: URL: https://github.com/apache/arrow/pull/43601#discussion_r1778207675
########## cpp/src/arrow/filesystem/s3_test_util.cc: ########## @@ -91,9 +121,21 @@ Status MinioTestServer::Start() { impl_->connect_string_ = GenerateConnectString(); ARROW_RETURN_NOT_OK(impl_->server_process_->SetExecutable(kMinioExecutableName)); // NOTE: --quiet makes startup faster by suppressing remote version check - impl_->server_process_->SetArgs({"server", "--quiet", "--compat", "--address", - impl_->connect_string_, - impl_->temp_dir_->path().ToString()}); + std::vector<std::string> start_args = {"server", "--quiet", "--compat", "--address", + impl_->connect_string_}; + + // create the dedicated folder for certificate file, rather than reuse the data + // folder, since there is test case to check whether the folder is empty. + ARROW_ASSIGN_OR_RAISE(impl_->temp_dir_ca_, TemporaryDir::Make("s3fs-test-ca-")); + GenerateCertificateFile(); + start_args.push_back("--certs-dir"); + start_args.push_back(ca_path()); + arrow::fs::FileSystemGlobalOptions global_options; + global_options.tls_ca_dir_path = ca_path(); + ARROW_RETURN_NOT_OK(arrow::fs::Initialize(global_options)); + // apply the data path at the end since some minio version only support it at the end + start_args.push_back(impl_->temp_dir_->path().ToString()); + impl_->server_process_->SetArgs(start_args); Review Comment: How about prepare certificates before setting args? ```suggestion // create the dedicated folder for certificate file, rather than reuse the data // folder, since there is test case to check whether the folder is empty. ARROW_ASSIGN_OR_RAISE(impl_->temp_dir_ca_, TemporaryDir::Make("s3fs-test-ca-")); GenerateCertificateFile(); arrow::fs::FileSystemGlobalOptions global_options; global_options.tls_ca_dir_path = ca_path(); ARROW_RETURN_NOT_OK(arrow::fs::Initialize(global_options)); impl_->server_process_->SetArgs({server", "--quiet", "--compat", "--address", impl_->connect_string_, "--certs-dir", ca_path(), impl_->temp_dir_->path().ToString()}); ``` ########## cpp/src/arrow/filesystem/s3_test_util.cc: ########## @@ -91,9 +121,21 @@ Status MinioTestServer::Start() { impl_->connect_string_ = GenerateConnectString(); ARROW_RETURN_NOT_OK(impl_->server_process_->SetExecutable(kMinioExecutableName)); // NOTE: --quiet makes startup faster by suppressing remote version check - impl_->server_process_->SetArgs({"server", "--quiet", "--compat", "--address", - impl_->connect_string_, - impl_->temp_dir_->path().ToString()}); + std::vector<std::string> start_args = {"server", "--quiet", "--compat", "--address", + impl_->connect_string_}; + + // create the dedicated folder for certificate file, rather than reuse the data + // folder, since there is test case to check whether the folder is empty. + ARROW_ASSIGN_OR_RAISE(impl_->temp_dir_ca_, TemporaryDir::Make("s3fs-test-ca-")); + GenerateCertificateFile(); + start_args.push_back("--certs-dir"); + start_args.push_back(ca_path()); + arrow::fs::FileSystemGlobalOptions global_options; + global_options.tls_ca_dir_path = ca_path(); + ARROW_RETURN_NOT_OK(arrow::fs::Initialize(global_options)); Review Comment: Why do we need this? Can we use local client configurations instead of global options? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: github-unsubscr...@arrow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org