Commit 4dc5a01
committed
fix(ignore_topology_change_coordinator_errors): support sct_config parameter
PR scylladb/scylla-cluster-tests/scylladb#10386 filter some expected
raft error messages globally. But this change broke integration
unit test. Issue scylladb#10676.
This fix 2 things:
- change function signature to run with passed sct config for
unit tests or get sct running config
- correctly filter error events.
ignore_topology_change_coordinator_errors is context manager
created as generator wrapped contextlib.contextmanager
and DBEventsFilter are created using ExitStack as ContextManagers.
To call this contextmanagers, was used
`ignore_topology_change_coordinator_errors().__enter__()` call
but once this call finished, all DBEventsFilters contextmangers
executed theirs __exit__() method and thus all event filters marked
as expired and appriate events are not filterd out. To avoid that,
ExitStack object recreated and all __exit__ methods will be triggered
after `yield`. This allow to run `ignore_topology_change_coordinator_errors`
as context manager to wrap some code/functions/method
or execute it globally withou events expiring
Fixes scylladb#106761 parent 020154a commit 4dc5a01
File tree
3 files changed
+25
-14
lines changed- sdcm/sct_events
- unit_tests
3 files changed
+25
-14
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
75 | | - | |
| 75 | + | |
| 76 | + | |
76 | 77 | | |
77 | 78 | | |
78 | 79 | | |
79 | 80 | | |
80 | 81 | | |
81 | 82 | | |
82 | | - | |
| 83 | + | |
83 | 84 | | |
84 | 85 | | |
85 | 86 | | |
| |||
98 | 99 | | |
99 | 100 | | |
100 | 101 | | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
111 | 113 | | |
| 114 | + | |
112 | 115 | | |
113 | 116 | | |
114 | 117 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
154 | 154 | | |
155 | 155 | | |
156 | 156 | | |
157 | | - | |
| 157 | + | |
158 | 158 | | |
159 | 159 | | |
160 | 160 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
412 | 412 | | |
413 | 413 | | |
414 | 414 | | |
415 | | - | |
| 415 | + | |
416 | 416 | | |
417 | 417 | | |
418 | 418 | | |
| |||
439 | 439 | | |
440 | 440 | | |
441 | 441 | | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
442 | 449 | | |
443 | 450 | | |
444 | 451 | | |
| |||
451 | 458 | | |
452 | 459 | | |
453 | 460 | | |
| 461 | + | |
454 | 462 | | |
455 | 463 | | |
456 | 464 | | |
| |||
0 commit comments