Skip to content

Regression in error handling #2446

@Jimver

Description

@Jimver

Description

There is a regression when upgrading from 3.44.0 to 3.44.1 where tasks start failing even if they shouldn't.

In the example below all tasks should pass, and they do in 3.44.0 but in 3.44.1 the should-pass task fails.

Note that I need to use /usr/bin/false just using false doesn't work as that doesn't spawn a new process I think, if for some reason you don't have /usr/bin/false you can just write a script that contains exit 1 it has the same effect.

Looking at the diff v3.44.0...v3.44.1, I suspect 8a43ca5 to be the cause.

Version

3.44.1

Operating system

zsh 5.9 (x86_64-apple-darwin23.0)

Experiments Enabled

None

Test results

go-task version should-pass should-pass-fixed
3.44.1 FAIL PASS
3.44.0 PASS PASS

Example Taskfile

version: '3'

tasks:
  should-pass:
    cmds:
      - |
        if /usr/bin/false &>/dev/null; then
          echo "should not reach here"
        fi

  should-pass-fixed:
    cmds:
      - |
        if /usr/bin/false &>/dev/null; then
          echo "should not reach here"
        fi
        true

Metadata

Metadata

Assignees

No one assigned

    Labels

    state: needs triageWaiting to be triaged by a maintainer.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions