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

Bug in testing utility function JobSetActive #530

Closed
danielvegamyhre opened this issue Apr 18, 2024 · 2 comments · Fixed by #531
Closed

Bug in testing utility function JobSetActive #530

danielvegamyhre opened this issue Apr 18, 2024 · 2 comments · Fixed by #531
Assignees
Labels
kind/bug Categorizes issue or PR as related to a bug.

Comments

@danielvegamyhre
Copy link
Contributor

@jedwins1998 encountered a bug when working on tests for configurable failure policy changes, tests would pass when using JobSetFailed() to check the JobSet has a failed condition type with a status of true, but also would pass when JobSetFailed() was changed to JobSetActive().

I think this is because in JobSetActive we are simply passing in an empty list of conditions to checkJobSetStatus, which verifies all given conditions are set on the jobset status.

However, even for a failed JobSet, the number of conditions matching an empty list of conditions will be 0, and the check will return ok, which it should not.

Instead, we should change JobSetActive to verify there are no mutually exclusive conditions set on the JobSet status, like failed or completed.

@danielvegamyhre danielvegamyhre added the kind/bug Categorizes issue or PR as related to a bug. label Apr 18, 2024
@jedwins1998
Copy link
Contributor

/assign

@jedwins1998
Copy link
Contributor

jedwins1998 commented Apr 18, 2024

The JobSet condition types are defined here.

I am planning to apply the definition that a JobSet is considered active as long as none of the following conditions have a status of true:

  1. JobSetCompleted,
  2. JobSetFailed,
  3. JobSetSuspended.

In particular, an active JobSet can still have the conditions JobSetStartupPolicyInProgress and JobSetStartupPolicyCompleted with any given status. Please comment if you see potential issues with this definition.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants