Skip to content

Commit

Permalink
Merge pull request python-trio#150 from njsmith/typo-fix
Browse files Browse the repository at this point in the history
[doc] typo fix
  • Loading branch information
njsmith committed May 8, 2017
2 parents 1aed71d + b0dcf46 commit f6fad04
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
4 changes: 2 additions & 2 deletions docs/source/reference-core.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ If you want to use trio, then the first thing you have to do is call
.. autofunction:: run


General principle
-----------------
General principles
------------------

.. _checkpoints:

Expand Down
13 changes: 11 additions & 2 deletions trio/_core/tests/test_ki.py
Original file line number Diff line number Diff line change
Expand Up @@ -426,22 +426,31 @@ def kill_soon():
# deterministically interlock with that, so we have to use sleep and
# hope it's long enough.
time.sleep(1)
print("thread doing ki_self()")
ki_self()
if buggy_wakeup_fd:
print("buggy_wakeup_fd =", buggy_wakeup_fd)
ki_self()

async def main():
thread = threading.Thread(target=kill_soon)
print("Starting thread")
thread.start()
try:
with pytest.raises(KeyboardInterrupt):
# To limit the damage on CI if this does get broken (as
# compared to sleep_forever())
print("Going to sleep")
await sleep(20)
print("Woke without raising?!") # pragma: no cover
finally:
thread.join()

start = time.time()
_core.run(main)
end = time.time()
try:
_core.run(main)
finally:
end = time.time()
print("duration", start - end)
print("sys.exc_info", sys.exc_info())
assert 1.0 <= (end - start) < 2

0 comments on commit f6fad04

Please sign in to comment.