chaostoolkit-lib icon indicating copy to clipboard operation
chaostoolkit-lib copied to clipboard

Whenever using settings.yaml file, before and after activity control called only from 1 control.

Open WixoLeo opened this issue 2 years ago • 4 comments

Describe the bug If I have a multiple sets of controls in my experiment, and they all have before_activity_control and after_activity_control, (In addition I use an empty(or not empty) control in settings.yaml) and if I run the experiment using this command:

chaos --settings=settings.yaml run exp.json

Then only the first set of before and after activity is being called and not the rest.

Runtime versions

Python 3.9.2
CLI                 1.10.0    
Core library        1.22.1

To Reproduce I've made a repository for that with the readme file: https://github.com/WixoLeo/ctk-tests

We have a simple exp.json and a simple plugin for the chaos. That plugin contains a simple probe and action. Along that it contains 2 control files. global_control.py and playground_control.py.

global_control is empty (it doesn't matter if it's empty or not, the result will be the same) It's empty in order to reduce the amount of speculations of where could be the issue. this control is being used only in settings.yaml

In the exp.json I've placed playground_control, 2 times, every event inside that file prints out the name of the function. So that we could see in the console which controls are being called and which aren't.

So if we run the experiment, we would expect to see a print of every control event twice. However, for some reason, specifically the before and after activity events, are printed only once. Additionally, before and after experiment control is being printed 3 times for some reason. When I would expect to see them only twice each.

image

Expected behavior I would expect every activity control to be run from all controls.

WixoLeo avatar Oct 06 '21 08:10 WixoLeo

Hello @WixoLeo

Thanks for the report and GH repo. But I'm confused. The settings file links to a control where everything is commented out. can you explain?

Lawouach avatar Oct 06 '21 12:10 Lawouach

Yes, I've commented them out so it would turn into a minimal version of the issue, as less code as possible. But the results are the same even if it's uncommented. @Lawouach

WixoLeo avatar Oct 06 '21 12:10 WixoLeo

Also there are 2 control files, one that is being used in settings.yaml, and another in exp.json, same one multiple times (Tested also with multiple different controls and still same result)

WixoLeo avatar Oct 06 '21 13:10 WixoLeo

Thanks. It's styill confusing what I'm meant to see.

Lawouach avatar Oct 06 '21 13:10 Lawouach

This Issue has not been active in 365 days. To re-activate this Issue, remove the Stale label or comment on it. If not re-activated, this Issue will be closed in 7 days.

github-actions[bot] avatar Mar 05 '23 01:03 github-actions[bot]

This Issue was closed because it was not reactivated after 7 days of being marked Stale.

github-actions[bot] avatar Mar 19 '23 01:03 github-actions[bot]