Repository navigation
Commit 7c87c61
authored
Helper: replace the last sleeping loop with the consistency helper its only caller needs (#8183)
WaitForDeploymentReplicaCountChange was the one loop in tests/helper still
timed by time.Sleep after #8068 and #8085. It polled a deployment for a fixed
number of iterations and returned the replica count at the point it first
changed, or the last count seen when the iterations ran out.
Its only remaining caller, azure_workload_identity_user_assigned, compares
that count to 0 after 30 x 1s to check that a ScaledObject with the wrong
identity does not scale the deployment out. That is a "stays at 0 for the
window" assertion, and AssertReplicaCountNotChangeDuringTimePeriod already
expresses exactly that on top of KedaConsistently: it observes the count on
every attempt inside the window instead of only reporting the first change,
and it does not fold a failed read into a 0 that looks like a scale to zero.
The caller now uses it with the same 30s window; the message that claimed a
minute was describing the loop wrongly.
With no callers left, the helper is removed rather than converted. Its name
suggested a wait for a change, while the two callers it had left both used it
to assert that nothing changed, and #8110 already had to fix the other one,
which called it with the arguments transposed into a no-op.
tests/helper/helper.go no longer contains a time.Sleep.
Relates to #7991
Signed-off-by: Mikhail Fedosin <mfedosin@redhat.com>1 parent 96b94e4 commit 7c87c61
2 files changed
Lines changed: 4 additions & 33 deletions
File tree
- tests
- helper
- secret-providers/azure_workload_identity_user_assigned
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
730 | 730 | | |
731 | 731 | | |
732 | 732 | | |
733 | | - | |
734 | | - | |
735 | | - | |
736 | | - | |
737 | | - | |
738 | | - | |
739 | | - | |
740 | | - | |
741 | | - | |
742 | | - | |
743 | | - | |
744 | | - | |
745 | | - | |
746 | | - | |
747 | | - | |
748 | | - | |
749 | | - | |
750 | | - | |
751 | | - | |
752 | | - | |
753 | | - | |
754 | | - | |
755 | | - | |
756 | | - | |
757 | | - | |
758 | | - | |
759 | | - | |
760 | | - | |
761 | | - | |
762 | | - | |
763 | 733 | | |
764 | 734 | | |
765 | 735 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
188 | 188 | | |
189 | 189 | | |
190 | 190 | | |
191 | | - | |
192 | | - | |
193 | | - | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
194 | 195 | | |
195 | 196 | | |
196 | 197 | | |
| |||
0 commit comments