Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion test/src/unit-capi-array.cc
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@
#include "tiledb/sm/enums/encryption_type.h"
#include "tiledb/sm/enums/serialization_type.h"
#include "tiledb/sm/fragment/fragment_identifier.h"
#include "tiledb/sm/global_state/unit_test_config.h"
#include "tiledb/sm/serialization/array.h"
#include "tiledb/sm/serialization/fragments.h"

Expand Down
1 change: 0 additions & 1 deletion test/src/unit-capi-filestore.cc
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
#include "test/support/src/vfs_helpers.h"
#include "tiledb/sm/c_api/tiledb.h"
#include "tiledb/sm/c_api/tiledb_experimental.h"
#include "tiledb/sm/global_state/unit_test_config.h"
#include "tiledb/sm/misc/constants.h"

using namespace tiledb::test;
Expand Down
1 change: 0 additions & 1 deletion test/src/unit-capi-fragment_info.cc
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
#include "test/support/src/helpers.h"
#include "test/support/src/serialization_wrappers.h"
#include "tiledb/sm/c_api/tiledb.h"
#include "tiledb/sm/global_state/unit_test_config.h"

#include <test/support/tdb_catch.h>
#include <iostream>
Expand Down
1 change: 0 additions & 1 deletion test/src/unit-capi-group.cc
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
#include "tiledb/common/stdx_string.h"
#include "tiledb/sm/c_api/tiledb.h"
#include "tiledb/sm/enums/encryption_type.h"
#include "tiledb/sm/global_state/unit_test_config.h"
#include "tiledb/sm/misc/tdb_time.h"

#include <iostream>
Expand Down
1 change: 0 additions & 1 deletion test/src/unit-capi-metadata.cc
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
#include "tiledb/sm/c_api/tiledb.h"
#include "tiledb/sm/c_api/tiledb_struct_def.h"
#include "tiledb/sm/enums/encryption_type.h"
#include "tiledb/sm/global_state/unit_test_config.h"
#include "tiledb/sm/misc/tdb_time.h"

#ifdef _WIN32
Expand Down
1 change: 0 additions & 1 deletion test/src/unit-cppapi-group.cc
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
#include "tiledb/sm/c_api/tiledb.h"
#include "tiledb/sm/cpp_api/group.h"
#include "tiledb/sm/enums/encryption_type.h"
#include "tiledb/sm/global_state/unit_test_config.h"

#include <iostream>
#include <sstream>
Expand Down
12 changes: 9 additions & 3 deletions test/src/unit-s3.cc
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
#include "tiledb/common/thread_pool/thread_pool.h"
#include "tiledb/sm/config/config.h"
#include "tiledb/sm/filesystem/s3.h"
#include "tiledb/sm/global_state/unit_test_config.h"
#include "tiledb/sm/misc/tdb_time.h"

#include <fstream>
Expand Down Expand Up @@ -110,8 +109,15 @@ TEST_CASE_METHOD(S3Fx, "Test S3 multiupload abort path", "[s3]") {
write_buffer[i] = (char)('a' + (i % 26));

for (const int nth_failure : {2, 5, 10}) {
auto _ = UnitTestConfig::instance().s3_fail_every_nth_upload_request.set(
nth_failure);
auto fail_every_nth_upload =
tiledb::sm::intercept::s3_get_make_upload_part_req().and_also(
[nth_failure](
unsigned part_num, bool& success, bool& induced_failure) {
if (part_num % nth_failure == 0) {
success = false;
induced_failure = true;
}
});

// Write one large file, the write will fail
auto largefile =
Expand Down
1 change: 0 additions & 1 deletion test/src/unit-vfs.cc
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@
#endif
#include "test/support/src/vfs_helpers.h"
#include "tiledb/sm/filesystem/vfs.h"
#include "tiledb/sm/global_state/unit_test_config.h"
#ifdef _WIN32
#include "tiledb/sm/filesystem/path_win.h"
#endif
Expand Down
1 change: 0 additions & 1 deletion test/support/src/helpers.cc
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@
#include "tiledb/sm/cpp_api/tiledb"
#include "tiledb/sm/enums/encryption_type.h"
#include "tiledb/sm/filesystem/uri.h"
#include "tiledb/sm/global_state/unit_test_config.h"
#include "tiledb/sm/misc/constants.h"
#include "tiledb/sm/misc/tile_overlap.h"
#include "tiledb/sm/serialization/array.h"
Expand Down
1 change: 0 additions & 1 deletion tiledb/sm/array/array.cc
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@
#include "tiledb/sm/enums/query_type.h"
#include "tiledb/sm/enums/serialization_type.h"
#include "tiledb/sm/fragment/fragment_metadata.h"
#include "tiledb/sm/global_state/unit_test_config.h"
#include "tiledb/sm/misc/parallel_functions.h"
#include "tiledb/sm/misc/tdb_time.h"
#include "tiledb/sm/object/object.h"
Expand Down
18 changes: 9 additions & 9 deletions tiledb/sm/filesystem/s3.cc
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@
#include "tiledb/common/unique_rwlock.h"
#include "tiledb/platform/platform.h"
#include "tiledb/sm/config/config_iter.h"
#include "tiledb/sm/global_state/unit_test_config.h"
#include "tiledb/sm/misc/tdb_math.h"

#ifdef _WIN32
Expand Down Expand Up @@ -228,6 +227,10 @@ using namespace tiledb::common;

namespace tiledb::sm {

namespace intercept {
DEFINE_INTERCEPT(s3_get_make_upload_part_req, unsigned, bool&, bool&);
}

S3Parameters::Headers S3Parameters::load_headers(const Config& cfg) {
Headers ret;
auto iter = ConfigIter(cfg, constants::s3_header_prefix);
Expand Down Expand Up @@ -1884,14 +1887,11 @@ Status S3::get_make_upload_part_req(
bool success = upload_part_outcome.IsSuccess();
bool induced_failure = false;

static const UnitTestConfig& unit_test_cfg = UnitTestConfig::instance();
if (unit_test_cfg.s3_fail_every_nth_upload_request.is_set() &&
ctx.upload_part_num %
unit_test_cfg.s3_fail_every_nth_upload_request.get() ==
0) {
success = false;
induced_failure = true;
}
INTERCEPT(
intercept::s3_get_make_upload_part_req,
ctx.upload_part_num,
success,
induced_failure);

if (!success) {
UniqueReadLock unique_rl(&multipart_upload_rwlock_);
Expand Down
5 changes: 5 additions & 0 deletions tiledb/sm/filesystem/s3.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
#include "tiledb/common/rwlock.h"
#include "tiledb/common/status.h"
#include "tiledb/common/thread_pool/thread_pool.h"
#include "tiledb/common/util/intercept.h"
#include "tiledb/platform/platform.h"
#include "tiledb/sm/buffer/buffer.h"
#include "tiledb/sm/config/config.h"
Expand Down Expand Up @@ -99,6 +100,10 @@ class S3Exception : public StatusException {
}
};

namespace intercept {
DECLARE_INTERCEPT(s3_get_make_upload_part_req, unsigned int, bool&, bool&);
}

namespace {

/**
Expand Down
168 changes: 0 additions & 168 deletions tiledb/sm/global_state/unit_test_config.h

This file was deleted.

1 change: 0 additions & 1 deletion tiledb/sm/group/group.cc
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
#include "tiledb/sm/enums/datatype.h"
#include "tiledb/sm/enums/encryption_type.h"
#include "tiledb/sm/enums/query_type.h"
#include "tiledb/sm/global_state/unit_test_config.h"
#include "tiledb/sm/group/group_details_v1.h"
#include "tiledb/sm/group/group_details_v2.h"
#include "tiledb/sm/group/group_member_v1.h"
Expand Down
1 change: 0 additions & 1 deletion tiledb/sm/group/group_details.cc
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
#include "tiledb/sm/enums/encryption_type.h"
#include "tiledb/sm/enums/query_type.h"
#include "tiledb/sm/filesystem/uri.h"
#include "tiledb/sm/global_state/unit_test_config.h"
#include "tiledb/sm/group/group_details_v1.h"
#include "tiledb/sm/group/group_details_v2.h"
#include "tiledb/sm/group/group_member_v1.h"
Expand Down
Loading