postgres-operator/pkg
Jonathan Juares Beber 4b440e59de
Fix test flakiness on TestSameService (#833)
The code added on #818 depends on map sorting to return a static reason
for service annotation changes. To avoid tests flakiness and map sorting
the tests include a `strings.HasPrefix` instead of comparing the whole
string. One of the test cases,
`service_removes_a_custom_annotation,_adds_a_new_one_and_change_another`,
is trying to test the whole reason string.

This commit replaces the test case reason, for only the reason prefix.
It removes the flakiness from the tests. As all the cases (annotation
adding, removing and value changing) are tested before, it's safe to
test only prefixes.

Also, it renames the test name from `TestServiceAnnotations` to
`TestSameService` and introduces a better description in case of test
failure, describing that only prefixes are tested.
2020-02-18 16:45:44 +01:00
..
apis/acid.zalan.do Fix MasterPodMoveTimeout field that cannot be unmarshalled (#816) 2020-02-11 17:16:38 +01:00
apiserver reflect change in github url (#496) 2019-02-25 11:26:55 +01:00
cluster switch to rbac/v1 (#829) 2020-02-17 11:25:07 +01:00
controller switch to rbac/v1 (#829) 2020-02-17 11:25:07 +01:00
generated update copyright in generated code (#779) 2020-01-02 17:34:49 +01:00
spec Fix golint failures 2019-01-08 13:04:48 +01:00
util Fix test flakiness on TestSameService (#833) 2020-02-18 16:45:44 +01:00