Skip to content

Commit

Permalink
ARROW-15113: [C++] Make GcsFileSystem tests a bit faster
Browse files Browse the repository at this point in the history
Before:

```
80/86 Test apache#50: arrow-gcsfs-test ..........................   Passed   13.52 sec
```

After:

```
64/86 Test apache#50: arrow-gcsfs-test ..........................   Passed    4.95 sec
```

Closes apache#11959 from coryan/ARROW-15113-gcsfs-speedup-tests-take2

Authored-by: Carlos O'Ryan <coryan@google.com>
Signed-off-by: Antoine Pitrou <antoine@python.org>
  • Loading branch information
coryan authored and rafael-telles committed Dec 20, 2021
1 parent a35c5ff commit 8a43ad3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cpp/src/arrow/filesystem/gcsfs_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -201,12 +201,13 @@ class GcsIntegrationTest : public ::testing::Test {
const char* const kTestFolders[] = {
"a/", "a/0/", "a/0/0/", "a/1/", "a/2/",
};
constexpr auto kFilesPerFolder = 4;
auto result = Hierarchy{PreexistingBucketPath() + "a/", {}};
for (auto const* f : kTestFolders) {
const auto folder = PreexistingBucketPath() + f;
RETURN_NOT_OK(fs->CreateDir(folder, true));
result.contents.push_back(arrow::fs::Dir(folder));
for (int i = 0; i != 64; ++i) {
for (int i = 0; i != kFilesPerFolder; ++i) {
const auto filename = folder + "test-file-" + std::to_string(i);
CreateFile(fs.get(), filename, filename);
result.contents.push_back(arrow::fs::File(filename));
Expand Down

0 comments on commit 8a43ad3

Please sign in to comment.