Skip to content

Commit e272a53

Browse files
authored
[core] Fix windows production issue (#50197)
Signed-off-by: dentiny <[email protected]>
1 parent 0e26901 commit e272a53

File tree

1 file changed

+21
-21
lines changed

1 file changed

+21
-21
lines changed

src/ray/util/tests/pipe_logger_test.cc

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,14 @@ TEST(PipeLoggerTest, RedirectionTest) {
4646

4747
// Take the default option, which doesn't have rotation enabled.
4848
StreamRedirectionOption stream_redirection_opt{};
49-
stream_redirection_opt.file_path = test_file_path.native();
49+
stream_redirection_opt.file_path = test_file_path.string();
5050
auto stream_redirection_handle = CreateRedirectionFileHandle(stream_redirection_opt);
5151
stream_redirection_handle.CompleteWrite(kLogLine1.data(), kLogLine1.length());
5252
stream_redirection_handle.CompleteWrite(kLogLine2.data(), kLogLine2.length());
5353
stream_redirection_handle.Close();
5454

5555
// Check log content after completion.
56-
const auto actual_content = ReadEntireFile(test_file_path.native());
56+
const auto actual_content = ReadEntireFile(test_file_path.string());
5757
RAY_ASSERT_OK(actual_content);
5858
const std::string expected_content = absl::StrFormat("%s%s", kLogLine1, kLogLine2);
5959
EXPECT_EQ(*actual_content, expected_content);
@@ -69,7 +69,7 @@ TEST(PipeLoggerTestWithTee, RedirectionWithTee) {
6969
};
7070

7171
StreamRedirectionOption stream_redirection_opt{};
72-
stream_redirection_opt.file_path = test_file_path.native();
72+
stream_redirection_opt.file_path = test_file_path.string();
7373
stream_redirection_opt.tee_to_stdout = true;
7474

7575
// Capture stdout via `dup`.
@@ -85,7 +85,7 @@ TEST(PipeLoggerTestWithTee, RedirectionWithTee) {
8585
EXPECT_EQ(stdout_content, absl::StrFormat("%s%s", kLogLine1, kLogLine2));
8686

8787
// Check log content after completion.
88-
const auto actual_content = ReadEntireFile(test_file_path.native());
88+
const auto actual_content = ReadEntireFile(test_file_path.string());
8989
RAY_ASSERT_OK(actual_content);
9090
EXPECT_EQ(*actual_content, absl::StrFormat("%s%s", kLogLine1, kLogLine2));
9191
}
@@ -105,7 +105,7 @@ TEST(PipeLoggerTestWithTee, RotatedRedirectionWithTee) {
105105
};
106106

107107
StreamRedirectionOption stream_redirection_opt{};
108-
stream_redirection_opt.file_path = test_file_path.native();
108+
stream_redirection_opt.file_path = test_file_path.string();
109109
stream_redirection_opt.rotation_max_size = 5;
110110
stream_redirection_opt.rotation_max_file_count = 2;
111111
stream_redirection_opt.tee_to_stderr = true;
@@ -123,11 +123,11 @@ TEST(PipeLoggerTestWithTee, RotatedRedirectionWithTee) {
123123
EXPECT_EQ(stderr_content, absl::StrFormat("%s%s", kLogLine1, kLogLine2));
124124

125125
// Check log content after completion.
126-
const auto actual_content1 = ReadEntireFile(log_file_path1.native());
126+
const auto actual_content1 = ReadEntireFile(log_file_path1.string());
127127
RAY_ASSERT_OK(actual_content1);
128128
EXPECT_EQ(*actual_content1, kLogLine2);
129129

130-
const auto actual_content2 = ReadEntireFile(log_file_path2.native());
130+
const auto actual_content2 = ReadEntireFile(log_file_path2.string());
131131
RAY_ASSERT_OK(actual_content2);
132132
EXPECT_EQ(*actual_content2, kLogLine1);
133133
}
@@ -142,7 +142,7 @@ TEST(PipeLoggerCompatTest, CompatibilityTest) {
142142
const auto test_file_path = scoped_directory.GetDirectory() / GenerateUUIDV4();
143143

144144
StreamRedirectionOption logging_option{};
145-
logging_option.file_path = test_file_path;
145+
logging_option.file_path = test_file_path.string();
146146
logging_option.tee_to_stdout = true;
147147

148148
testing::internal::CaptureStdout();
@@ -154,7 +154,7 @@ TEST(PipeLoggerCompatTest, CompatibilityTest) {
154154
EXPECT_EQ(stdout_content, kContent);
155155

156156
// Pipe logger automatically adds a newliner at the end.
157-
const auto actual_content = ReadEntireFile(test_file_path.native());
157+
const auto actual_content = ReadEntireFile(test_file_path.string());
158158
RAY_ASSERT_OK(actual_content);
159159
EXPECT_EQ(*actual_content, "hello\n");
160160

@@ -168,7 +168,7 @@ TEST(PipeLoggerCompatTest, CompatibilityTest) {
168168
const auto test_file_path = scoped_directory.GetDirectory() / GenerateUUIDV4();
169169

170170
StreamRedirectionOption logging_option{};
171-
logging_option.file_path = test_file_path;
171+
logging_option.file_path = test_file_path.string();
172172
logging_option.tee_to_stdout = true;
173173

174174
testing::internal::CaptureStdout();
@@ -179,7 +179,7 @@ TEST(PipeLoggerCompatTest, CompatibilityTest) {
179179
const std::string stdout_content = testing::internal::GetCapturedStdout();
180180
EXPECT_EQ(stdout_content, kContent);
181181

182-
const auto actual_content = ReadEntireFile(test_file_path.native());
182+
const auto actual_content = ReadEntireFile(test_file_path.string());
183183
RAY_ASSERT_OK(actual_content);
184184
EXPECT_EQ(*actual_content, "hello\n");
185185

@@ -193,7 +193,7 @@ TEST(PipeLoggerCompatTest, CompatibilityTest) {
193193
const auto test_file_path = scoped_directory.GetDirectory() / GenerateUUIDV4();
194194

195195
StreamRedirectionOption logging_option{};
196-
logging_option.file_path = test_file_path;
196+
logging_option.file_path = test_file_path.string();
197197
logging_option.tee_to_stdout = true;
198198

199199
testing::internal::CaptureStdout();
@@ -205,7 +205,7 @@ TEST(PipeLoggerCompatTest, CompatibilityTest) {
205205
EXPECT_EQ(stdout_content, kContent);
206206

207207
// Pipe logger automatically adds a newliner at the end.
208-
const auto actual_content = ReadEntireFile(test_file_path.native());
208+
const auto actual_content = ReadEntireFile(test_file_path.string());
209209
RAY_EXPECT_OK(actual_content);
210210
EXPECT_EQ(*actual_content, "hello\nworld\n");
211211

@@ -219,7 +219,7 @@ TEST(PipeLoggerCompatTest, CompatibilityTest) {
219219
const auto test_file_path = scoped_directory.GetDirectory() / GenerateUUIDV4();
220220

221221
StreamRedirectionOption logging_option{};
222-
logging_option.file_path = test_file_path;
222+
logging_option.file_path = test_file_path.string();
223223
logging_option.tee_to_stdout = true;
224224

225225
testing::internal::CaptureStdout();
@@ -230,7 +230,7 @@ TEST(PipeLoggerCompatTest, CompatibilityTest) {
230230
const std::string stdout_content = testing::internal::GetCapturedStdout();
231231
EXPECT_EQ(stdout_content, kContent);
232232

233-
const auto actual_content = ReadEntireFile(test_file_path.native());
233+
const auto actual_content = ReadEntireFile(test_file_path.string());
234234
RAY_EXPECT_OK(actual_content);
235235
EXPECT_EQ(*actual_content, "hello\nworld\n");
236236

@@ -244,7 +244,7 @@ TEST(PipeLoggerCompatTest, CompatibilityTest) {
244244
const auto test_file_path = scoped_directory.GetDirectory() / GenerateUUIDV4();
245245

246246
StreamRedirectionOption logging_option{};
247-
logging_option.file_path = test_file_path;
247+
logging_option.file_path = test_file_path.string();
248248
logging_option.tee_to_stdout = true;
249249

250250
testing::internal::CaptureStdout();
@@ -255,7 +255,7 @@ TEST(PipeLoggerCompatTest, CompatibilityTest) {
255255
const std::string stdout_content = testing::internal::GetCapturedStdout();
256256
EXPECT_EQ(stdout_content, kContent);
257257

258-
const auto actual_content = ReadEntireFile(test_file_path.native());
258+
const auto actual_content = ReadEntireFile(test_file_path.string());
259259
RAY_EXPECT_OK(actual_content);
260260
EXPECT_EQ(*actual_content, "helloworld\n\n\n");
261261

@@ -269,7 +269,7 @@ TEST(PipeLoggerCompatTest, CompatibilityTest) {
269269
const auto test_file_path = scoped_directory.GetDirectory() / GenerateUUIDV4();
270270

271271
StreamRedirectionOption logging_option{};
272-
logging_option.file_path = test_file_path;
272+
logging_option.file_path = test_file_path.string();
273273
logging_option.tee_to_stdout = true;
274274

275275
testing::internal::CaptureStdout();
@@ -281,7 +281,7 @@ TEST(PipeLoggerCompatTest, CompatibilityTest) {
281281
EXPECT_EQ(stdout_content, kContent);
282282

283283
// Pipe logger automatically adds a newliner at the end.
284-
const auto actual_content = ReadEntireFile(test_file_path.native());
284+
const auto actual_content = ReadEntireFile(test_file_path.string());
285285
RAY_EXPECT_OK(actual_content);
286286
EXPECT_EQ(*actual_content, "hello\n\n\nworld\n");
287287

@@ -295,7 +295,7 @@ TEST(PipeLoggerCompatTest, CompatibilityTest) {
295295
const auto test_file_path = scoped_directory.GetDirectory() / GenerateUUIDV4();
296296

297297
StreamRedirectionOption logging_option{};
298-
logging_option.file_path = test_file_path;
298+
logging_option.file_path = test_file_path.string();
299299
logging_option.tee_to_stdout = true;
300300

301301
testing::internal::CaptureStdout();
@@ -307,7 +307,7 @@ TEST(PipeLoggerCompatTest, CompatibilityTest) {
307307
EXPECT_EQ(stdout_content, kContent);
308308

309309
// Pipe logger automatically adds a newliner at the end.
310-
const auto actual_content = ReadEntireFile(test_file_path.native());
310+
const auto actual_content = ReadEntireFile(test_file_path.string());
311311
RAY_ASSERT_OK(actual_content);
312312
EXPECT_EQ(*actual_content, "hello\n\nworld\n\n");
313313

0 commit comments

Comments
 (0)