gofrs / uuid

A UUID package for Go
MIT License
1.57k stars 110 forks source link

Update V2 test to use delay to guarantee unique UUID generation #70

Closed theckman closed 5 years ago

theckman commented 5 years ago

This change updates the uniqueness test for the NewV2() function to have a time hop between the two generations of the UUID. This should avoid known deficiencies in V2 UUIDs causing the test to fail. Specifically, that unique UUIDs are only generated every 7 seconds.

This enhances the comment on the NewV2 function to make it clear that using it is not recommended, and that it has some deficiencies.

Finally, I added some #nosec comments to make gosec not flag our usage of SHA1 or MD5 as being unsafe.

Fixes #69

Signed-off-by: Tim Heckman t@heckman.io

codecov-io commented 5 years ago

Codecov Report

Merging #70 into master will not change coverage. The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master      #70   +/-   ##
=======================================
  Coverage   98.92%   98.92%           
=======================================
  Files           4        4           
  Lines         279      279           
=======================================
  Hits          276      276           
  Misses          2        2           
  Partials        1        1
Impacted Files Coverage Δ
generator.go 97.22% <100%> (ø) :arrow_up:

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 6b08a5c...8183840. Read the comment docs.

codecov-io commented 5 years ago

Codecov Report

Merging #70 into master will not change coverage. The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master      #70   +/-   ##
=======================================
  Coverage   98.92%   98.92%           
=======================================
  Files           4        4           
  Lines         279      279           
=======================================
  Hits          276      276           
  Misses          2        2           
  Partials        1        1
Impacted Files Coverage Δ
generator.go 97.22% <100%> (ø) :arrow_up:

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 6b08a5c...4494bbc. Read the comment docs.

theckman commented 5 years ago

cc @CameronAckermanSEL

zerkms commented 5 years ago

Btw, does it really change only every 7 seconds? Yesterday I did not have chance to check everything in details, it sounds crazy though if true.

and why tests on linux pass?

theckman commented 5 years ago

Closing in favor of #71.