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

[WIP] Cancellation test #611

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft

[WIP] Cancellation test #611

wants to merge 2 commits into from

Conversation

Menduist
Copy link
Contributor

Start of the cancellation test:

  • Adding awaitrc on cleanup to avoid cleanup being cancelled (and thus, leaks)
  • Adding a cancelTest which is cancelling every step of the way
  • Adding a simple connect test for now

Few notes:
The cancel test works like that:

    for i in 0..1000:
      echo "polling ", i ," times"
      let testFuture = cancelledTest()
      for _ in 0..<i:
        if testFuture.finished: break
        poll()
      if testFuture.finished: break

Poll is emptying the callback list, so a "computation only" future will only poll once.
For poll to return, there needs to be a IO wait or something like that.

So this is only testing cancellation a "IO operations"!

This is already good enough to leak on a simple connect, but not perfect yet.
(The simple connect test has 143 poll, but a simple switch start/stop has 1 poll)

awaitrc or equivalent should move to chronos

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

Successfully merging this pull request may close these issues.

1 participant