# Tests that we are able to deal with mutators that insert relative to
# steps that are later removed by subsequent mutations. The initial
# insertion should create a concurrent step with user-hooks (see
# `mutator_probabilities` test) and the second mutator removes user
# hooks, flattening that concurrent run.

add-mutators concurrent_user_hooks_mutator remove_user_hooks_mutator
----
ok

# ensure both mutators are always applied
mixed-version-test num_upgrades=1 mutator_probabilities=(concurrent_user_hooks_mutator, 1, remove_user_hooks_mutator, 1)
----
ok

in-mixed-version name=(my mixed version feature)
----
ok

plan debug=true
----
Seed:               12345
Upgrades:           v24.2.2 → <current>
Deployment mode:    system-only
Mutators:           concurrent_user_hooks_mutator, remove_user_hooks_mutator
Plan:
├── install fixtures for version "v24.2.2" (1) [stage=system-setup]
├── start cluster at version "v24.2.2" (2) [stage=system-setup]
├── wait for all nodes (:1-4) to acknowledge cluster version '24.2' on system tenant (3) [stage=system-setup]
└── upgrade cluster from "v24.2.2" to "<current>"
   ├── prevent auto-upgrades on system tenant by setting `preserve_downgrade_option` (4) [stage=init]
   ├── upgrade nodes :1-4 from "v24.2.2" to "<current>"
   │   ├── restart node 4 with binary version <current> (5) [stage=temporary-upgrade]
   │   ├── testSingleStep (6) [stage=temporary-upgrade]
   │   ├── restart node 3 with binary version <current> (7) [stage=temporary-upgrade]
   │   ├── restart node 2 with binary version <current> (8) [stage=temporary-upgrade]
   │   └── restart node 1 with binary version <current> (9) [stage=temporary-upgrade]
   ├── downgrade nodes :1-4 from "<current>" to "v24.2.2"
   │   ├── restart node 2 with binary version v24.2.2 (10) [stage=rollback-upgrade]
   │   ├── restart node 1 with binary version v24.2.2 (11) [stage=rollback-upgrade]
   │   ├── testSingleStep (12) [stage=rollback-upgrade]
   │   ├── restart node 3 with binary version v24.2.2 (13) [stage=rollback-upgrade]
   │   └── restart node 4 with binary version v24.2.2 (14) [stage=rollback-upgrade]
   ├── upgrade nodes :1-4 from "v24.2.2" to "<current>"
   │   ├── restart node 3 with binary version <current> (15) [stage=last-upgrade]
   │   ├── restart node 1 with binary version <current> (16) [stage=last-upgrade]
   │   ├── restart node 4 with binary version <current> (17) [stage=last-upgrade]
   │   ├── testSingleStep (18) [stage=last-upgrade]
   │   └── restart node 2 with binary version <current> (19) [stage=last-upgrade]
   ├── allow upgrade to happen on system tenant by resetting `preserve_downgrade_option` (20) [stage=running-upgrade-migrations,finalizing]
   └── wait for all nodes (:1-4) to acknowledge cluster version <current> on system tenant (21) [stage=running-upgrade-migrations,finalizing]
