Skip to content

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

@WixoLeo

Description

@WixoLeo

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions