Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added sleep in dataframe_memory_leak test after gc collection #494

Merged
merged 2 commits into from
Feb 4, 2025
Merged
Changes from 1 commit
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
6 changes: 6 additions & 0 deletions test_container/tests/test/pandas/all/dataframe_memory_leak.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ def test_dataframe_scalar_emits(self):

import tracemalloc
import gc
import time
snapshot_begin = None
memory_check_executed = False
tracemalloc.start()
Expand All @@ -111,6 +112,7 @@ def run(ctx):
assert memory_check_executed == False #Sanity check for row number
print("Checking memory usage", flush=True)
gc.collect()
time.sleep(1)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In case it works we should a comment to the sleeps

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.
The CI Build failed because of Docker.

snapshot_end = tracemalloc.take_snapshot()
top_stats_begin_end = snapshot_end.compare_to(snapshot_begin, 'lineno')
first_item = top_stats_begin_end[0] #First item is always the largest one
Expand Down Expand Up @@ -203,6 +205,7 @@ def test_dataframe_scalar_returns(self):

import tracemalloc
import gc
import time
snapshot_begin = None
memory_check_executed = False
tracemalloc.start()
Expand All @@ -220,6 +223,7 @@ def run(ctx):
assert memory_check_executed == False #Sanity check for row number
print("Checking memory usage", flush=True)
gc.collect()
time.sleep(1)
snapshot_end = tracemalloc.take_snapshot()
top_stats_begin_end = snapshot_end.compare_to(snapshot_begin, 'lineno')
first_item = top_stats_begin_end[0] #First item is always the largest one
Expand Down Expand Up @@ -254,6 +258,7 @@ def test_dataframe_set_emits(self):

import tracemalloc
import gc
import time
tracemalloc.start()

def process_df(ctx):
Expand All @@ -272,6 +277,7 @@ def run(ctx):

if batch_idx == ({batch_count} - 1):
gc.collect()
time.sleep(1)
snapshot_end = tracemalloc.take_snapshot()
top_stats_begin_end = snapshot_end.compare_to(snapshot_begin, 'lineno')
first_item = top_stats_begin_end[0] #First item is always the largest one
Expand Down
Loading