Skip to content

Conversation

@1spyral
Copy link
Contributor

@1spyral 1spyral commented Nov 10, 2025

Fixes #5320

Proposed changes

Fetches the existing experiments with the declared experiment name and compares it with the experiment being edited. If they are the same, skip the duplicate name check which was previously erroring.

Changes to tests:

  • Mock the fetch for the existing experiment
  • Rename tests to use success and failure like other tests in file
  • Add test to ensure that passing a duplicate experiment name throws an error

Types of changes

What types of changes does your code introduce to Litmus? Put an x in the boxes that apply

  • New feature (non-breaking change which adds functionality)
  • Bugfix (non-breaking change which fixes an issue)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation Update (if none of the other choices applies)

Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.

  • I have read the CONTRIBUTING doc
  • I have signed the commit for DCO to be passed.
  • Lint and unit tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works (if appropriate)
  • I have added necessary documentation (if appropriate)

@1spyral 1spyral marked this pull request as ready for review November 10, 2025 20:26
@1spyral 1spyral force-pushed the fix-existing-name-failing-update-chaos-experiment branch from 0f0a2ad to 0de3a6d Compare November 18, 2025 22:41
@1spyral
Copy link
Contributor Author

1spyral commented Nov 18, 2025

@SarthakJain26 thanks for the review! I've optimized the check to use one DB query. Let me know if everything looks good to you!

@1spyral 1spyral force-pushed the fix-existing-name-failing-update-chaos-experiment branch 2 times, most recently from 8ed3350 to 6478553 Compare December 11, 2025 14:43
… error

Modified tests:
- Mock the fetch for the existing experiment
- Rename tests to use `success` and `failure` like other tests in file
- Add test to ensure that passing a duplicate experiment name throws an error

Signed-off-by: Luke Zhan <luke.zhan@uwaterloo.ca>
@1spyral 1spyral force-pushed the fix-existing-name-failing-update-chaos-experiment branch from 6478553 to 40e2f66 Compare December 11, 2025 14:44
@1spyral
Copy link
Contributor Author

1spyral commented Dec 11, 2025

Fixed outdated mocks in fuzz test

@SarthakJain26
Copy link
Contributor

graphq-server build pipeline failing due to vulnerability scanning. Will fix the vulnerability in another PR.

@SarthakJain26 SarthakJain26 merged commit dce7673 into litmuschaos:master Dec 12, 2025
19 of 20 checks passed
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 this pull request may close these issues.

Calling UpdateChaosExperiment with same name returns error

3 participants