Skip to content

Commit 3d3735c

Browse files
author
jparisu
committed
Refs #15841: Fix test ad-hoc creation and not deletion of an entity
Signed-off-by: jparisu <[email protected]>
1 parent f79fb6c commit 3d3735c

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

test/unittest/Database/DatabaseStatusTests.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ class database_status_tests : public ::testing::Test
4141
locator = db.locators().begin()->second;
4242

4343
// Simulate that the backend is monitorizing the domain
44+
// NOTE: This is so F*** dangerous, please do not do it again (1)
4445
std::shared_ptr<details::Monitor> monitor = std::make_shared<details::Monitor>();
4546
details::StatisticsBackendData::get_instance()->monitors_by_entity_[domain->id] = monitor;
4647

@@ -79,6 +80,13 @@ class database_status_tests : public ::testing::Test
7980
details::StatisticsBackendData::DiscoveryStatus::DISCOVERY);
8081
}
8182

83+
84+
void TearDown()
85+
{
86+
// NOTE: This is thanks to (1) brilliant idea
87+
details::StatisticsBackendData::get_instance()->monitors_by_entity_.erase(domain->id);
88+
}
89+
8290
std::shared_ptr<Host> host;
8391
std::shared_ptr<User> user;
8492
std::shared_ptr<Process> process;

0 commit comments

Comments
 (0)