Skip to content

Commit 421c14d

Browse files
author
SendaoYan
committed
8366558: Gtests leave /tmp/cgroups-test* files
Backport-of: 49fd6a0cb4ddabaa865155bbfd4290077b7d13ea
1 parent 12abba9 commit 421c14d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

test/hotspot/gtest/runtime/test_cgroupSubsystem_linux.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,6 @@ TEST(cgroupTest, read_string_tests) {
341341
ok = controller->read_string(base_with_slash, result, 1024);
342342
EXPECT_FALSE(ok) << "Empty file should have failed";
343343
EXPECT_STREQ("", result) << "Expected untouched result";
344-
delete_file(test_file);
345344

346345
// File contents larger than 1K
347346
// We only read in the first 1K - 1 bytes
@@ -358,6 +357,8 @@ TEST(cgroupTest, read_string_tests) {
358357
EXPECT_TRUE(1023 == strlen(result)) << "Expected only the first 1023 chars to be read in";
359358
EXPECT_EQ(0, strncmp(too_large, result, 1023));
360359
EXPECT_EQ(result[1023], '\0') << "The last character must be the null character";
360+
361+
delete_file(test_file);
361362
}
362363

363364
TEST(cgroupTest, read_number_tuple_test) {
@@ -393,6 +394,8 @@ TEST(cgroupTest, read_number_tuple_test) {
393394
ok = controller->read_numerical_tuple_value(base_with_slash, true /* use_first */, &result);
394395
EXPECT_FALSE(ok) << "Empty file should be an error";
395396
EXPECT_EQ((jlong)-10, result) << "result value should be unchanged";
397+
398+
delete_file(test_file);
396399
}
397400

398401
TEST(cgroupTest, read_numerical_key_beyond_max_path) {

0 commit comments

Comments
 (0)