Commit Graph

491 Commits (ed3a945104e206d4d24e0d68ea61e162455311af)
 

Author SHA1 Message Date
dw ed3a945104
Merge pull request #63 from rbricheno/master
Prevent MacOS exception on shutdown of closed socket.
7 years ago
R W H Bricheno 8fb0234176 Prevent MacOS exception on shutdown of closed socket. 7 years ago
dw 0952b7a12f
Merge pull request #60 from rbricheno/master
Fix getting the directory path on Mac OS X.
7 years ago
R W H Bricheno 5a9c9d7101 Fix getting the directory path on Mac OS X. 7 years ago
David Wilson a01c929d76 Fix Python 3 fix :/ closes #57 7 years ago
dw e925db6b33 Merge pull request #54 from moreati/source-for-the-goose
tests: Fix GetModuleViaPkgutilTest fetching .pyc
7 years ago
dw fa4e9fa9f2 Merge pull request #59 from moreati/wait-for-it
fakessh: Remove colon causing SyntaxError
7 years ago
Alex Willmer e234781b05 fakessh: Remove colon causing SyntaxError
fixes #58
7 years ago
David Wilson 325f5323a5 fakessh: interruptible wait compatible with <2.7; closes #55 7 years ago
Alex Willmer 29529c9a5c tests: Fix GetModuleViaPkgutilTest fetching .pyc
On my laptop (Ubuntu 17.10, Python 2.7.14 in a virtualenv),
`test_regular_mod` fails with

```
AssertionError: "\nimport sys\n\n\ndef say_hi():\n    print 'hi'\n" !=
'\x03\xf3\r\n\xbbW\xd5Yc\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00@\x00\x00\x00s\x19\x00\x00\x00d\x00\x00d\x01\x00l\x00\x00Z\x00\x00d\x02\x00\x84\x00\x00Z\x01\x00d\x01\x00S(\x03\x00\x00\x00i\xff\xff\xff\xffNc\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00C\x00\x00\x00s\t\x00\x00\x00d\x01\x00GHd\x00\x00S(\x02\x00\x00\x00Nt\x02\x00\x00\x00hi(\x00\x00\x00\x00(\x00\x00\x00\x00(\x00\x00\x00\x00(\x00\x00\x00\x00sF\x00\x00\x00/home/alex/src/mitogen/tests/data/module_finder_testmod/regular_mod.pyt\x06\x00\x00\x00say_hi\x05\x00\x00\x00s\x02\x00\x00\x00\x00\x01(\x02\x00\x00\x00t\x03\x00\x00\x00sysR\x01\x00\x00\x00(\x00\x00\x00\x00(\x00\x00\x00\x00(\x00\x00\x00\x00sF\x00\x00\x00/home/alex/src/mitogen/tests/data/module_finder_testmod/regular_mod.pyt\x08\x00\x00\x00<module>\x02\x00\x00\x00s\x02\x00\x00\x00\x0c\x03'
```

`__file__` contains the path of the compiled `.pyc`, not the `.py`
source file.
7 years ago
David Wilson dacc57ba5f master: Lazy-format more logging arguments, minor 3.x compat increments 7 years ago
Alex Willmer a8dcd53ccc first stage: Remove/dedent else block
Since the above if block ends in a call to os.execv() this block will
only ever run when the if condition was false. Hence putting it in an
else clause is unnecessary.
7 years ago
Alex Willmer 8c085d1ea6 first stage: Use string concatenation 7 years ago
Alex Willmer 0ab6faa8b8 first stage: eliminate whitespace 7 years ago
Alex Willmer 9ee1d13270 first stage: single letter variables 7 years ago
David Wilson 805b4896a2 Add first_stage_test to Travis. 7 years ago
David Wilson 0bb2e94bf0 Sort .travis.yml 7 years ago
David Wilson f1660d5011 tests: initial first_stage_test. 7 years ago
David Wilson 58e30cd117 issue #49: 2.x/3.x compatible decode.
Much uglier command line, but it works across major Python releases.
7 years ago
David Wilson 36300b9fe6 docs: convert paragraph to footnote. 7 years ago
David Wilson 255656ef50 issue #49: update howitworks.rst for command line change 7 years ago
David Wilson cfb8a38977 Implement Alex's awesome idea of zlibbing the first stage too! Closes #49 7 years ago
David Wilson 2e8ed68609 Merge branch 'pr/50' 7 years ago
Alex Willmer fe2bf7111a ssh_test: Correct hostname in SShTest.test_stream_name()
I presume that `u1704` is a relic of a bygone container/host.
7 years ago
Alex Willmer a0fbe99be0 testlib: Wait for sshd before running tests
On Ubuntu 17.10 something (probably Docker) appears to be accepting
connections, before sshd is fully ready. This results in a race
condition, and hence connection errors for the first few tests (2-3 on
my laptop).

testlib.wait_for_port() checks not only that the port can be connected
to, but also something resembling the sshd banner is sent.

Fixes #51
7 years ago
Alex Willmer cae6989932 testlib: Auto negotiate Docker API version
Ubuntu 17.04 provides Docker 1.12.6, which has API version 1.24.
`dev_requirements.txt` specifies the docker-py 2.5.1, which by default
requests API version 1.30.

Hence when the SSH unit tests try to run the container specified in
`DockerizedSshDaemon` an error occurs

```
APIError: 400 Client Error: Bad Request ("client is newer than server
(client API version: 1.30, server API version: 1.24)")
```
7 years ago
David Wilson 492777f61b tests: stop responder_test spamming the logs 7 years ago
David Wilson 9e884d3d8b tests: stop fakessh spamming the logs 7 years ago
David Wilson ec7fe7dafa Merge branch 'setup' of https://github.com/moreati/mitogen
Thanks Alex!
7 years ago
David Wilson 94b8b794e9 Empty commit to trigger Travis after Docker push
d2mw/mitogen-test was out of date
7 years ago
Alex Willmer 61f9b46816 gitignore: distutils output files 7 years ago
Alex Willmer c0bcacf6f9 setup: Trove classifiers
These will help with future PyPI discovery, and should make it clear
that Python 3.x is not (yet) supported.
7 years ago
Alex Willmer dfb0fd8244 setup: Add a hashbang
- Uses /usr/bin/env so it still works in e.g. a virtualenv
- Uses python2, rather than python3 to indicate mitogen currently being
2.x only.
7 years ago
Alex Willmer 990afe7d2f setup: Use correct packages declaration
py_packages is not a field know by distutils or setuptools. The closest
is `py_modules`, which perhaps what the erroneus line here started as.

Fixes #43
7 years ago
David Wilson 9f48fd69c1 Bump time allowance for fakessh_test 7 years ago
David Wilson baf4380b6d Ensure _run_defer() fully executes at least once before shutdown
Without this, it's possible for Waker to be start_received() after the
shutdown signal has already been sent, resulting in 5 second delay
during shutdown.

Additionally mask EBADF during os.write() to waker's write side.
Necessary since nothing synchronizes writer threads from the broker
thread during shutdown. Could be done with a lock instead, but this is
cheaper.
7 years ago
David Wilson 8c6d861f15 Bump time allowance for ssh_test. 7 years ago
David Wilson 3b2596b125 Bump time allowance for select_test. 7 years ago
David Wilson c83d86f050 importer: Delete _get_module_via_parent entirely
Can't figure out what it's supposed to do any more, and can't find a
version of Ansible before August 2016 (when I wrote that code) that
seems to need it.

Add some more mitigations to avoid sending dylibs.
7 years ago
David Wilson dcea7ac616 docs: waiting on multiple calls 7 years ago
David Wilson 8f42a58281 docs: move Router.route() into Sphinx. 7 years ago
David Wilson b43cd31d59 docs: Add warning to preloading section. 7 years ago
David Wilson 48096ab033 docs: move Broker docstrings into Sphinx. 7 years ago
dw e2883bd553 Merge pull request #47 from moreati/cant-mock-the-rock
Add mock requirement
7 years ago
Alex Willmer 68673e4ccd Add mock requirement 7 years ago
David Wilson 7eb81a1694 docs: more getting started guide 7 years ago
David Wilson f19d18350d mitop: fix overlong command lines corrupting the followign line 7 years ago
David Wilson 686c77e901 mitop: Show new processes in bold. 7 years ago
David Wilson d800b684ef Merge branch 'module-preloading'
Not much point in keeping the docs changes separate.
7 years ago
David Wilson 0b141ade62 docs: getting started 7 years ago