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

python: fix handle barrier method to return a Future #5825

Merged
merged 3 commits into from Mar 25, 2024

Conversation

grondo
Copy link
Contributor

@grondo grondo commented Mar 24, 2024

flux_barrier(3) returns a flux_future_t, but the Python handle barrier method returns nothing.

This PR returns a Future from handle.barrier() as is necessary for proper functionality and updates callers.

Note: Clearly the barrier unit tests were not working, but I didn't have any good ideas how to properly test the barrier functionality, so left it alone for now besides addition of the missing get() calls.

Problem: The flux_barrier(3) function returns a future, but the Python
wrapper function calls the C api without returning anything.

Return the result of flux_barrier() wrapped in a Future so that the
call is functional from Python.
Problem: The issues/t2492-shell-lost.sh reproducer calls flux_barrier()
but does not wait for the result.

Add the missing .get() call to h.barrier().
Problem: The get() calls to the Python barrier() methods are missing
in t/python/t0003-barrier.py.

Add the missing get() calls.
@grondo
Copy link
Contributor Author

grondo commented Mar 24, 2024

FYI - as a side effect this should fix the intermittent CI failures of t2492-shell-lost.sh

Copy link
Member

@garlick garlick left a comment

Choose a reason for hiding this comment

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

Good catch!

Copy link

codecov bot commented Mar 24, 2024

Codecov Report

Merging #5825 (25ac989) into master (794be81) will decrease coverage by 0.02%.
The diff coverage is 100.00%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5825      +/-   ##
==========================================
- Coverage   83.36%   83.35%   -0.02%     
==========================================
  Files         509      509              
  Lines       82515    82515              
==========================================
- Hits        68787    68777      -10     
- Misses      13728    13738      +10     
Files Coverage Δ
src/bindings/python/flux/core/handle.py 96.71% <100.00%> (ø)

... and 11 files with indirect coverage changes

@mergify mergify bot merged commit f607734 into flux-framework:master Mar 25, 2024
35 checks passed
@grondo grondo deleted the python-barrier branch March 25, 2024 00:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants