jaswdr / faker

:rocket: Ultimate fake data generator for Go with zero dependencies
https://pkg.go.dev/github.com/jaswdr/faker
MIT License
549 stars 59 forks source link

[BUG] Flaking tests around time. #85

Closed xlanor closed 2 years ago

xlanor commented 2 years ago

Some of the tests are flaky and failing randomly - mainly related to TestUNIXTime and the like. I've noticed 3 of them randomly failing so far and am opening this issue to investigate at a later stage. This should not be related to any changes in the crypto feature that I was writing as these are in completely different files and non-overlapping.

Edit: Managed to get the verbose output.

=== RUN   TestRFC1123
    time_test.go:74: 
        Expected: (int) 29 
        Got:      (int) 31
--- FAIL: TestRFC1123 (0.00s)

=== RUN   TestUnixDate
    time_test.go:43: 
        Expected: (int) 28 
        Got:      (int) 30
--- FAIL: TestUnixDate (0.00s)

=== RUN   TestRFC822
    time_test.go:55: 
        Expected: (int) 19 
        Got:      (int) 21
--- FAIL: TestRFC822 (0.00s)
jaswdr commented 2 years ago

Thanks for reporting, I'll check those errors

jaswdr commented 2 years ago

@xlanor can you give more details about the environment where you are seeing these errors? What is the OS, architecture and go version that you are using?

xlanor commented 2 years ago

Not a problem. It's currently late here but off the top of the head I am only able to reproduce this in a docker Ubuntu environment (doing it using code-server with go 1.17.3)

I'll be able to pull more information tomorrow and hopefully reproduce it. Currently it's sparodic, but the only consistent thing is that when it fails, all three of them fail.

jaswdr commented 2 years ago

I released a fix that potentially would fix this issue, could you try to update to v1.10.2 and try again?

xlanor commented 2 years ago

I'll try it out and let you know!

jaswdr commented 2 years ago

@xlanor since you haven't come back, I'm assuming this issue is fixed, I'm closing but let me know if the issue persists.