-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathriegeli_dataset_reader_test.diff
55 lines (49 loc) · 2.3 KB
/
riegeli_dataset_reader_test.diff
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
diff --git a/envlogger/backends/cc/riegeli_dataset_reader_test.cc b/envlogger/backends/cc/riegeli_dataset_reader_test.cc
index 9add0fb..d27adb3 100644
--- a/envlogger/backends/cc/riegeli_dataset_reader_test.cc
+++ b/envlogger/backends/cc/riegeli_dataset_reader_test.cc
@@ -160,6 +160,7 @@ TEST(DataDirectoryIndex, SimpleMetadataAndSpec) {
const auto actual_metadata = reader.Metadata();
EXPECT_THAT(actual_metadata, Not(Eq(std::nullopt)));
EXPECT_THAT(*actual_metadata, EqualsProto(metadata));
+ reader.Close();
ENVLOGGER_EXPECT_OK(file::RecursivelyDelete(data_dir));
}
@@ -223,6 +224,7 @@ TEST(DataDirectoryIndex, OneShard) {
EXPECT_THAT(episodes, ElementsAre(EqualsEpisode(0, 3), EqualsEpisode(3, 2)));
EXPECT_THAT(episodes[0].metadata, Not(Eq(std::nullopt)));
EXPECT_THAT(*episodes[0].metadata, EqualsProto(episode0_metadata));
+ reader.Close();
ENVLOGGER_EXPECT_OK(file::RecursivelyDelete(data_dir));
}
@@ -286,6 +288,7 @@ TEST(DataDirectoryIndex, OneShardNonDmDataPayload) {
EXPECT_THAT(episodes, ElementsAre(EqualsEpisode(0, 3), EqualsEpisode(3, 2)));
EXPECT_THAT(episodes[0].metadata, Not(Eq(std::nullopt)));
EXPECT_THAT(*episodes[0].metadata, EqualsProto(episode0_metadata));
+ reader.Close();
ENVLOGGER_EXPECT_OK(file::RecursivelyDelete(data_dir));
}
@@ -348,6 +351,7 @@ TEST(DataDirectoryIndex, TwoShards) {
}
EXPECT_THAT(episodes, ElementsAre(EqualsEpisode(0, 3), EqualsEpisode(3, 2),
EqualsEpisode(5, 1), EqualsEpisode(6, 3)));
+ reader.Close();
ENVLOGGER_EXPECT_OK(file::RecursivelyDelete(data_dir));
}
@@ -418,6 +422,9 @@ TEST(DataDirectoryIndex, GetShardTest) {
episode1_steps,
ElementsAre(EqualsProto("datum: { values: { float_values: 4.0}}"),
EqualsProto("datum: { values: { float_values: 5.0}}")));
+ reader.Close();
+ episode0->Close();
+ episode1->Close();
ENVLOGGER_EXPECT_OK(file::RecursivelyDelete(data_dir));
}
@@ -483,6 +490,8 @@ TEST(DataDirectoryIndex, CloneTest) {
EqualsProto("datum: { values: { float_values: 3.0}}"),
EqualsProto("datum: { values: { float_values: 4.0}}"),
EqualsProto("datum: { values: { float_values: 5.0}}")));
+ reader.Close();
+ clone->Close();
ENVLOGGER_EXPECT_OK(file::RecursivelyDelete(data_dir));
}