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

Incorrect behavior of runExperiment field during createChaosExperiment #4362

Closed
pimoens opened this issue Dec 29, 2023 · 0 comments · Fixed by #4496
Closed

Incorrect behavior of runExperiment field during createChaosExperiment #4362

pimoens opened this issue Dec 29, 2023 · 0 comments · Fixed by #4496
Assignees
Labels

Comments

@pimoens
Copy link

pimoens commented Dec 29, 2023

When trying to create a new Experiment through the GraphQL API using the createChaosExperiment mutation, the behavior of the required field runExperiment seems to be incorrect.
If the boolean is set to false, it still executes a run of the created experiment. When the boolean is set to true it seems to be executing two runs simultaneously.

Output of kubectl get workflow -n litmus after creating two experiments, one with runExperiment=false and one with runExperiment=true:

NAME STATUS AGE
run-experiment-false Running 25s
run-experiment-true Running 10s
run-experiment-true-1703863388584 Running 10s

Chaos Center:
image

Since I'm automating the fault injection and am creating a number of experiments at initialization, I'd need the experiments not to execute at creation.

Reproduce using the GraphQL API using Litmus v3.0.0

Mutation:

mutation createChaosExperiment($projectID: ID!, $request: ChaosExperimentRequest!) {
  createChaosExperiment(projectID: $projectID, request: $request) {
    experimentID,
    exerpimentName
  }
}

Variables:

{
 {
  "projectID": "", 
  "request": {
     "infraId": "",
     "experimentName": '",
     "experimentManifest": "",
     "runExperiment": false,
     "cron_syntax": "",
     "tags": [],
     "weightages": [],
     "isCustomExperiment": true
   }
}

Headers:

{"Authorization": ""}
@pimoens pimoens added the bug label Dec 29, 2023
amityt added a commit to amityt/litmus that referenced this issue Mar 6, 2024
…Experiment is disabled

Signed-off-by: Amit Kumar Das <amit.das@harness.io>
Saranya-jena pushed a commit that referenced this issue Apr 4, 2024
…is disabled (#4496)

* chore: [#4362]: Fixed experiment run execution even if runExperiment is disabled

Signed-off-by: Amit Kumar Das <amit.das@harness.io>

* fixed test case

Signed-off-by: Amit Kumar Das <amit.das@harness.io>

---------

Signed-off-by: Amit Kumar Das <amit.das@harness.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants