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

Move temporary dir deletion to inner function, delete temp dir in skipped benchmarks #248

Merged
merged 2 commits into from
Sep 29, 2023

Conversation

mpozniak95
Copy link
Collaborator

Opened again from branch created in this repository instead of forked branch.

Probably connected with issue: #244.

So far when some check resulted with skipping benchmark, it would keep an empty temporary directory in home directory. Deletion of temporary dir should happen in such situation before continuing to the next benchmark.

This PR moves temporary directory deletion to inner function in process_self_contained_coordinator_stream and invokes it before skipping any benchmark

@codecov-commenter
Copy link

codecov-commenter commented Sep 5, 2023

Codecov Report

Patch coverage: 33.33% and project coverage change: -0.19% ⚠️

Comparison is base (ba1b405) 56.71% compared to head (c9ce358) 56.52%.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #248      +/-   ##
==========================================
- Coverage   56.71%   56.52%   -0.19%     
==========================================
  Files          24       24              
  Lines        2234     2245      +11     
==========================================
+ Hits         1267     1269       +2     
- Misses        967      976       +9     
Files Changed Coverage Δ
...tained_coordinator__/self_contained_coordinator.py 57.95% <ø> (ø)
...edis_benchmarks_specification/__runner__/runner.py 62.58% <33.33%> (-1.14%) ⬇️

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -912,9 +912,7 @@ def process_self_contained_coordinator_stream(
logging.critical("Printing redis container log....")
print("-" * 60)
print(
redis_container.logs(
stdout=True, stderr=True, logs=True
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Also there was an issue with this line in contained_coordinator. When benchmark raised an exception for any reason we tried to print container logs but it resulted with: TypeError: ContainerApiMixin.logs() got an unexpected keyword argument 'logs'. According to https://docker-py.readthedocs.io/en/stable/containers.html#docker.models.containers.Container.logs parameter logs for method logs() doesn't exist. This led to skipping 'teardown' stage which led to temporary folders being left with the redis-server artifact inside.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

With that change instead we get:

2023-09-13 01:33:49 CRITICAL Some unexpected exception was caught during local work. Failing test....
2023-09-13 01:33:49 CRITICAL <class 'KeyError'>
2023-09-13 01:33:49 INFO Tearing down setup
2023-09-13 01:33:49 INFO When trying to stop DB container with id a9b45d05a8ba306464d79d3d0deeaa2a72dd7d8761b838aefe5d318326e1cf5e and image <Image: 'debian:buster'> it was already stopped
2023-09-13 01:33:49 INFO Removing temporary dirs /root/tmp7rhog4yu and /root/tmpkcu7fzqu

And temporary dirs are removed

Copy link
Collaborator

@markovamaria markovamaria left a comment

Choose a reason for hiding this comment

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

Hi @mpozniak95, thank you for PR!

Could you please fix integration test failure? This is failing - test_run_local_command_logic_oss_cluster according to log.

You can use these PRs for test's run reference:

Let me know in case of questions.

@mpozniak95
Copy link
Collaborator Author

I think that that wasn't fault of my PR, there was an "Connection Refused" exception when trying to connect to Redis. I re-run test and it worked.

@markovamaria markovamaria self-requested a review September 14, 2023 09:57
@markovamaria
Copy link
Collaborator

@filipecosta90 , could you please check and merge if you are agree?

@slice4e slice4e merged commit 517d487 into main Sep 29, 2023
@slice4e slice4e deleted the always_delete_temp_dir branch September 29, 2023 18:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants