Skip to content

Round delay in call_later() #236

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

Merged
merged 1 commit into from
Mar 18, 2019
Merged

Conversation

fantix
Copy link
Member

@fantix fantix commented Mar 17, 2019

  • Write unit test.
  • Make the test pass.

@fantix fantix force-pushed the t233_round_call_later branch from 637ec91 to 784da49 Compare March 17, 2019 15:01
@fantix fantix changed the title [WIP] Round delay in call_later() Round delay in call_later() Mar 17, 2019
@jlaine
Copy link
Contributor

jlaine commented Mar 17, 2019

If we want to respect the guarantee that the CB is called "no earlier than X", isn't ceil() more appropriate than round()?

@fantix
Copy link
Member Author

fantix commented Mar 17, 2019

@jlaine replied in #233 (comment)

@jlaine
Copy link
Contributor

jlaine commented Mar 17, 2019

Ok sorry for the duplicate message

@fantix fantix force-pushed the t233_round_call_later branch 3 times, most recently from e81f90f to c486898 Compare March 17, 2019 23:07
@fantix fantix force-pushed the t233_round_call_later branch from c486898 to de6b915 Compare March 18, 2019 03:42
@1st1
Copy link
Member

1st1 commented Mar 18, 2019

So is the new test stable?

@fantix
Copy link
Member Author

fantix commented Mar 18, 2019

Yeah I think so

@1st1 1st1 merged commit 73529c5 into MagicStack:master Mar 18, 2019
@1st1
Copy link
Member

1st1 commented Mar 18, 2019

Alright, merged. Thank you! :)

@fantix fantix deleted the t233_round_call_later branch March 18, 2019 15:55
@1st1
Copy link
Member

1st1 commented Mar 20, 2019

@fantix got this CI failure this morning:

Screen Shot 2019-03-20 at 10 55 45 AM

Could you please take another look at the test? Is it possible to make it any more reliable? If not, I suggest we relax it a bit or drop it.

@1st1
Copy link
Member

1st1 commented Mar 20, 2019

(or maybe we should go with @jlaine suggestion to use ceil())

@fantix
Copy link
Member Author

fantix commented Mar 20, 2019

@1st1 ceil() may not fix this one - there's arbitrary time spent before the clock starts ticking. I think an absolute safe number would be 69, but it's probably not much meaningful anymore. For what is worth, maybe 69 for now?

@1st1
Copy link
Member

1st1 commented Mar 20, 2019

Let's try it... Would the old code (without round()) fail on that?

@fantix
Copy link
Member Author

fantix commented Mar 20, 2019

@1st1 the old code may probably succeed with this test at 69 I think

@1st1
Copy link
Member

1st1 commented Mar 20, 2019

Alright, I pushed e3b00b8

@fantix
Copy link
Member Author

fantix commented Mar 20, 2019

Oh, thanks for that! 🙇

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 this pull request may close these issues.

3 participants