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

False positive precondition fails if context is aborted #1337

Closed
sylv-io opened this issue Sep 15, 2023 · 0 comments · Fixed by #1338
Closed

False positive precondition fails if context is aborted #1337

sylv-io opened this issue Sep 15, 2023 · 0 comments · Fixed by #1338

Comments

@sylv-io
Copy link
Contributor

sylv-io commented Sep 15, 2023

I have a bug similar to #597 where you can see precondition false positives error print that can be reproduced with the following tasks:

version: '3'

tasks:
  default:
    deps:
      - fail-0s
      - pass-1s
    cmds:
      - "true"
  fail-0s:
    run: always
    preconditions:
      - sh: 'false'
        msg: "precondition should fail"

  pass-1s:
    run: always
    preconditions:
      - sh: 'sleep 1; true'
        msg: "precondition should never fail"

output:

$ task
task: precondition should fail
task: precondition should never fail
task: precondition not met

Context abort due to a failed context causes other conditions to print the error message as well.
I already found the reason, so a PR will follow soon 👍

  • Task version: main (72d77eb)
  • Operating system: Arch Linux
  • Experiments enabled: no
@task-bot task-bot added the state: needs triage Waiting to be triaged by a maintainer. label Sep 15, 2023
@andreynering andreynering added type: bug Something not working as intended. and removed state: needs triage Waiting to be triaged by a maintainer. labels Oct 7, 2023
@pd93 pd93 removed the type: bug Something not working as intended. label Dec 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants