Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FakeClock sleep blocks on negative duration #19

Closed
redgoattea opened this issue Feb 8, 2019 · 1 comment · Fixed by #24
Closed

FakeClock sleep blocks on negative duration #19

redgoattea opened this issue Feb 8, 2019 · 1 comment · Fixed by #24

Comments

@redgoattea
Copy link

According to the golang documentation for time.Sleep, when passed a zero or negative duration, the function returns immediately.

FakeClock correctly handles a zero duration, but ends up blocking for negative durations, thus requiring the clock to be advanced by zero to unblock the sleeper (which should never have been blocked to begin with).

@lyonssp
Copy link
Contributor

lyonssp commented Mar 21, 2020

Just opened a PR for a fix #24

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants