This is an automated email from the ASF dual-hosted git repository.
cmcfarlen pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git
The following commit(s) were added to refs/heads/master by this push:
new 7cc8e3a0e8 Fix asan leak errors for cachevol test (#11239)
7cc8e3a0e8 is described below
commit 7cc8e3a0e84c54ae209003ea52d904f32df3b6e6
Author: Chris McFarlen <[email protected]>
AuthorDate: Fri Apr 12 14:54:22 2024 -0500
Fix asan leak errors for cachevol test (#11239)
* Fix asan leak errors for cachevol test
* uneeded
---
src/iocore/cache/unit_tests/test_CacheVol.cc | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/src/iocore/cache/unit_tests/test_CacheVol.cc
b/src/iocore/cache/unit_tests/test_CacheVol.cc
index 3bed1afada..eafcbc3062 100644
--- a/src/iocore/cache/unit_tests/test_CacheVol.cc
+++ b/src/iocore/cache/unit_tests/test_CacheVol.cc
@@ -323,6 +323,10 @@ ClearCacheVolList(Queue<CacheVol> *cpl, int len)
int i = 0;
CacheVol *cp = nullptr;
while ((cp = cpl->dequeue())) {
+ for (int d_no = 0; d_no < gndisks; d_no++) {
+ cp->disk_stripes[d_no]->disk->delete_volume(cp->vol_number);
+ cp->disk_stripes[d_no] = nullptr;
+ }
ats_free(cp->disk_stripes);
ats_free(cp->stripes);
delete (cp);
@@ -365,6 +369,8 @@ public:
cache_init_success_callback(int event, void *e) override
{
// Test
+ ClearCacheVolList(&cp_list, cp_list_len);
+
save_state();
srand48(time(nullptr));
@@ -393,6 +399,5 @@ TEST_CASE("CacheVol")
this_ethread()->schedule_imm(init);
this_thread()->execute();
-
return;
}