Skip to content

Commit

Permalink
Merge pull request flux-framework#5394 from grondo/issue#5392
Browse files Browse the repository at this point in the history
flux-top: fix title when connected to instances that are not jobs
  • Loading branch information
mergify[bot] authored Aug 16, 2023
2 parents d69f9d7 + c80a8a2 commit f682677
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/cmd/top/top.c
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ static flux_jobid_t get_jobid (flux_t *h)
static char * build_title (struct top *top, const char *title)
{
if (!title)
title = idf58 (top->id);
title = top->id == FLUX_JOBID_ANY ? "" : idf58 (top->id);
return strdup (title);
}

Expand Down
7 changes: 7 additions & 0 deletions t/t2801-top-cmd.t
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,13 @@ test_expect_success 'flux-top summary shows no jobs initially' '
grep "0 running" nojobs.out &&
grep "0 failed" nojobs.out
'
# Note: jpXCZedGfVQ is the base58 representation of FLUX_JOBID_ANY. We
# grep for this value without f or ƒ in case build environment influences
# presence of one of the other.
#
test_expect_success 'flux-top does not display FLUX_JOBID_ANY jobid in title' '
test_must_fail grep jpXCZedGfVQ nojobs.out
'
test_expect_success 'run a test job to completion' '
flux submit --wait -n1 flux start /bin/true >jobid &&
job_list_wait_state $(cat jobid) INACTIVE
Expand Down

0 comments on commit f682677

Please sign in to comment.