Skip to content

Commit c48ba00

Browse files
authored
Merge pull request #4335 from grondo/fix-uri-resolve-error
python: fix confusing error message from pid URI resolver
2 parents 914dacf + be1b5a4 commit c48ba00

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

src/bindings/python/flux/uri/resolvers/pid.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def _get_broker_child(pid):
5959
return cpid
6060
except FileNotFoundError:
6161
pass
62-
raise ValueError(f"PID {broker_pid} is a flux-broker and no child found")
62+
raise ValueError(f"PID {pid} is a flux-broker and no child found")
6363

6464

6565
def _proc_has_task_children():

t/t2802-uri-cmd.t

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ test_description='Test flux uri command'
44

55
. $(dirname $0)/sharness.sh
66

7-
test_under_flux 1
7+
test_under_flux 2
88

99
testssh="${SHARNESS_TEST_SRCDIR}/scripts/tssh"
1010

@@ -51,6 +51,11 @@ test_expect_success 'flux-uri pid resolver works on flux-broker with fallback' '
5151
test "$(flux uri pid:$(flux getattr broker.pid))" = "$FLUX_URI"
5252
)
5353
'
54+
test_expect_success 'flux-uri pid resolver fails if broker has no child' '
55+
test_must_fail flux uri pid:$(flux exec -r 1 flux getattr broker.pid) \
56+
>broker-no-child.out 2>&1 &&
57+
grep "is a flux-broker and no child found" broker-no-child.out
58+
'
5459
test_expect_success 'flux-uri pid resolver fails for nonexistent pid' '
5560
test_expect_code 1 flux uri pid:123456
5661
'

0 commit comments

Comments
 (0)