Skip to content

Commit

Permalink
fix(userspace/libsinsp/test): put a bound to threat table max size test
Browse files Browse the repository at this point in the history
Signed-off-by: Jason Dellaluce <[email protected]>
  • Loading branch information
jasondellaluce committed Jan 31, 2024
1 parent 0f8c43e commit 09fd0a5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion userspace/libsinsp/test/thread_table.ut.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,8 @@ TEST_F(sinsp_with_test_input, THRD_TABLE_reparenting_in_the_default_tree)

TEST_F(sinsp_with_test_input, THRD_TABLE_max_table_size)
{
m_inspector.m_thread_manager->set_max_thread_table_size(10000);

add_default_init_thread();
open_inspector();

Expand All @@ -440,7 +442,7 @@ TEST_F(sinsp_with_test_input, THRD_TABLE_max_table_size)
/* Here we want to check that creating a number of threads grater
* than m_max_thread_table_size doesn't cause a crash.
*/
for(uint32_t i = 1; i < (m_inspector.m_thread_manager->m_max_thread_table_size + 10000); i++)
for(uint32_t i = 1; i < (m_inspector.m_thread_manager->m_max_thread_table_size + 1000); i++)
{
/* we change only the tid */
generate_clone_x_event(0, pid + i, pid, INIT_TID, PPM_CL_CLONE_THREAD);
Expand Down

0 comments on commit 09fd0a5

Please sign in to comment.