Skip to content

Same alert can be added to the same run multiple times with add_alert #695

@wk9874

Description

@wk9874

( to get add_alert to work at all, first change the deduplication line to self._sv_obj.alerts = list(set(list(self._sv_obj.alerts) + ids)))

Doing add_alert with the same alert multiple times will add it to the run multiple times, despite deduplication. This is because the full list of alerts in _staging is passed to commit each time, and the server doesnt seem to do any deduplication

TBD - might be a Server-side bug

with Run() as myrun:
    myrun.init(name="myrun", folder="/my/test/2")
    _id = myrun.create_metric_threshold_alert(
        name="my_test_alert_3",
        metric="test_metric",
        threshold = 20.0,
        rule = "is above",
        description = "dddh"
    )
    myrun.add_alerts(ids=[_id])
    myrun.add_alerts(ids=[_id])

Image

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions