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

change print to sys.stdout.write and flush in benchmark_runner.py #2155

Merged
merged 2 commits into from
Oct 6, 2023

Conversation

russell-liu
Copy link
Contributor

No description provided.

@@ -242,7 +242,8 @@ def run_kuzu(serialized_graph_path):
process = subprocess.Popen(
tuple(benchmark_cmd), stdout=subprocess.PIPE)
for line in iter(process.stdout.readline, b''):
print(line.decode("utf-8"), end='')
sys.stdout.write(line.decode("utf-8"))
sys.stdout.flush()
Copy link
Collaborator

Choose a reason for hiding this comment

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

You can also use the flush argument of print to explicitly flush, which is a little more concise.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good idea

@Riolku
Copy link
Contributor

Riolku commented Oct 5, 2023

Why is it sufficient to just flush? I would think that we need a lock.

@codecov
Copy link

codecov bot commented Oct 5, 2023

Codecov Report

All modified lines are covered by tests ✅

Comparison is base (bcfebce) 89.65% compared to head (6e90ce5) 89.64%.
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2155      +/-   ##
==========================================
- Coverage   89.65%   89.64%   -0.01%     
==========================================
  Files         989      989              
  Lines       35712    35712              
==========================================
- Hits        32016    32015       -1     
- Misses       3696     3697       +1     

see 1 file with indirect coverage changes

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

@russell-liu russell-liu requested a review from mewim October 5, 2023 22:32
@russell-liu
Copy link
Contributor Author

Any idea why MSVC CI is failing? I didn't expect my changes to have any effect on that.

@mewim
Copy link
Collaborator

mewim commented Oct 6, 2023

Why is it sufficient to just flush? I would think that we need a lock.

The benchmark queries are executed sequentially, not in parallel, so it seems to be just a printing issue, not a race condition.

@mewim
Copy link
Collaborator

mewim commented Oct 6, 2023

Any idea why MSVC CI is failing? I didn't expect my changes to have any effect on that.

The MSVC test might fail randomly. I have relaunched it.

@mewim mewim merged commit a8685f8 into master Oct 6, 2023
11 checks passed
@mewim mewim deleted the fix-benchmark-runner-out-of-order-output branch October 6, 2023 04:25
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.

None yet

4 participants