Skip to content
This repository has been archived by the owner on Jul 11, 2023. It is now read-only.

test/ads: fix unit test flakyness #3906

Merged
merged 1 commit into from
Aug 2, 2021
Merged

Conversation

eduser25
Copy link
Contributor

PR #3803 introduced a mapset (backed by golang map) to slice conversion,
which does not guarantee same output ordering for the same input,
thus was making a unit test fail from time to time.

This commit forces output of the slice to be alphabetically ordered,
ensuring determinism of the output slice for the same input mapset.

Signed-off-by: Eduard Serra [email protected]

| Tests | [x] |

  1. Does this change contain code from or inspired by another project?
    • Did you notify the maintainers and provide attribution?
      No
  2. Is this a breaking change?
    No

PR openservicemesh#3803 introduced a mapset (backed by golang map) to slice conversion,
which does not guarantee same output ordering for the same input,
thus was making a unit test fail from time to time.

This commit forces output of the slice to be alphabetically ordered,
ensuring determinism of the output slice for the same input mapset.

Signed-off-by: Eduard Serra <[email protected]>
@eduser25 eduser25 requested a review from a team as a code owner July 31, 2021 14:37
@eduser25 eduser25 changed the title test/ads: fix test flakyness test/ads: fix unit test flakyness Jul 31, 2021
@codecov-commenter
Copy link

Codecov Report

Merging #3906 (352c220) into main (65e567a) will increase coverage by 0.04%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3906      +/-   ##
==========================================
+ Coverage   67.43%   67.47%   +0.04%     
==========================================
  Files         202      202              
  Lines       11385    11386       +1     
==========================================
+ Hits         7677     7683       +6     
+ Misses       3657     3652       -5     
  Partials       51       51              
Flag Coverage Δ
unittests 67.47% <100.00%> (+0.04%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
pkg/envoy/ads/stream.go 10.71% <100.00%> (+0.45%) ⬆️
pkg/crdconversion/crdconversion.go 75.00% <0.00%> (+5.43%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 65e567a...352c220. Read the comment docs.

@eduser25 eduser25 merged commit 007ce99 into openservicemesh:main Aug 2, 2021
@eduser25 eduser25 deleted the fix-flaky branch August 2, 2021 15:49
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants