aboutsummaryrefslogtreecommitdiff
path: root/src/zenserver-test/cache-tests.cpp
diff options
context:
space:
mode:
authorDan Engelbrecht <[email protected]>2025-10-06 10:18:49 +0200
committerGitHub Enterprise <[email protected]>2025-10-06 10:18:49 +0200
commitd5b2a263e6d4c893c6ec3fb99b36110630da6529 (patch)
tree35bfa4c23c838fdbebd07100db2ebf2404977b3f /src/zenserver-test/cache-tests.cpp
parentfix link error with operator new (#553) (diff)
downloadzen-d5b2a263e6d4c893c6ec3fb99b36110630da6529.tar.xz
zen-d5b2a263e6d4c893c6ec3fb99b36110630da6529.zip
speed up tests (#555)
* faster FileSystemTraversal test * faster jobqueue test * faster NamedEvent test * faster cache tests * faster basic http tests * faster blockstore test * faster cache store tests * faster compactcas tests * more responsive zenserver launch * tweak worker pool sizes in tests
Diffstat (limited to 'src/zenserver-test/cache-tests.cpp')
-rw-r--r--src/zenserver-test/cache-tests.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/zenserver-test/cache-tests.cpp b/src/zenserver-test/cache-tests.cpp
index 2a040936c..1ce5f3be4 100644
--- a/src/zenserver-test/cache-tests.cpp
+++ b/src/zenserver-test/cache-tests.cpp
@@ -690,9 +690,9 @@ TEST_CASE("zcache.rpc")
CbPackage Package;
CHECK(Request.Format(Package));
- IoBuffer Body = FormatPackageMessageBuffer(Package).Flatten().AsIoBuffer();
- Body.SetContentType(HttpContentType::kCbPackage);
- HttpClient::Response Result = Http.Post("/$rpc", Body, {{"Accept", "application/x-ue-cbpkg"}});
+ CompositeBuffer Body(FormatPackageMessageBuffer(Package));
+ HttpClient::Response Result =
+ Http.Post("/$rpc", Body, HttpContentType::kCbPackage, HttpClient::Accept(HttpContentType::kCbPackage));
CHECK(Result.StatusCode == HttpResponseCode::OK);
if (OutPackages)
@@ -762,7 +762,7 @@ TEST_CASE("zcache.rpc")
const std::string BaseUri = fmt::format("http://localhost:{}/z$", BasePort);
CachePolicy Policy = CachePolicy::Default;
- std::vector<zen::CacheKey> Keys = PutCacheRecords(BaseUri, "ue4.ddc"sv, "mastodon"sv, 128);
+ std::vector<zen::CacheKey> Keys = PutCacheRecords(BaseUri, "ue4.ddc"sv, "mastodon"sv, 16);
GetCacheRecordResult Result = GetCacheRecords(BaseUri, "ue4.ddc"sv, Keys, Policy);
CHECK(Result.Result.Results.size() == Keys.size());
@@ -791,7 +791,7 @@ TEST_CASE("zcache.rpc")
const std::string BaseUri = fmt::format("http://localhost:{}/z$", BasePort);
CachePolicy Policy = CachePolicy::Default;
- std::vector<zen::CacheKey> ExistingKeys = PutCacheRecords(BaseUri, "ue4.ddc"sv, "mastodon"sv, 128);
+ std::vector<zen::CacheKey> ExistingKeys = PutCacheRecords(BaseUri, "ue4.ddc"sv, "mastodon"sv, 16);
std::vector<zen::CacheKey> Keys;
for (const zen::CacheKey& Key : ExistingKeys)
@@ -1244,7 +1244,7 @@ TEST_CASE("zcache.rpc")
const std::string BaseUri = fmt::format("http://localhost:{}/z$", BasePort);
std::vector<zen::CacheKey> SmallKeys = PutCacheRecords(BaseUri, "ue4.ddc"sv, "mastodon"sv, 4, 1024);
- std::vector<zen::CacheKey> LargeKeys = PutCacheRecords(BaseUri, "ue4.ddc"sv, "mastodon"sv, 4, 1024 * 1024 * 16, SmallKeys.size());
+ std::vector<zen::CacheKey> LargeKeys = PutCacheRecords(BaseUri, "ue4.ddc"sv, "mastodon"sv, 2, 1024 * 1024 * 16, SmallKeys.size());
std::vector<zen::CacheKey> Keys(SmallKeys.begin(), SmallKeys.end());
Keys.insert(Keys.end(), LargeKeys.begin(), LargeKeys.end());
@@ -1540,7 +1540,7 @@ TEST_CASE("zcache.failing.upstream")
}
Completed.fetch_add(1);
},
- WorkerThreadPool::EMode::EnableBacklog);
+ WorkerThreadPool::EMode::DisableBacklog);
}
bool UseUpstream1 = false;
while (Completed < ThreadCount * KeyMultiplier)
@@ -1634,7 +1634,7 @@ TEST_CASE("zcache.failing.upstream")
}
Completed.fetch_add(1);
},
- WorkerThreadPool::EMode::EnableBacklog);
+ WorkerThreadPool::EMode::DisableBacklog);
}
while (Completed < ThreadCount * KeyMultiplier)
{