Skip to content

Headless bar widget contract skip exits with status 1 #6337

Description

@almondsun

System details

Ryzen 3 5300U with integrated Radeon graphics, running the current quattro branch at 0526ebef. The test is run from a terminal without WAYLAND_DISPLAY set.

What is wrong?

The bar widget contract test prints a successful skip message in a headless environment, but exits with status 1:

$ env -u WAYLAND_DISPLAY bash test/shell.d/bar-widget-contract-test.sh
ok - no Wayland compositor; skipping bar widget contract test
$ echo $?
1

This also causes ./test/shell to stop at this test instead of continuing through the suite.

The EXIT trap calls cleanup, whose final command is a conditional [[ ... ]] && rm ... expression. On the early skip path, TMPDIR is unset, so that expression returns 1 and changes the explicit exit 0 into a failure.

Expected: the headless skip exits 0 and the aggregate shell suite continues.

A minimal fix is to make the optional temporary-directory cleanup an if block so a missing directory is a successful no-op.

Investigation and proposed fix prepared with Codex; I reproduced and reviewed the behavior locally.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions