aboutsummaryrefslogtreecommitdiffstats
path: root/test
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #3099 from Kriechi/fix-3024Aldo Cortesi2018-05-061-13/+35
|\ | | | | fix #3024
| * fix #3024Thomas Kriechbaumer2018-05-051-13/+35
| |
* | Remove custom eventsAldo Cortesi2018-05-031-15/+20
| | | | | | | | | | These were always weird, and were added to support exit when processing completed to mitmdump. We now have better ways to do this.
* | Remove the tick eventAldo Cortesi2018-05-023-21/+5
| | | | | | | | Mitmproxy: the tickless wonder.
* | taddons: remove has_eventAldo Cortesi2018-05-021-1/+0
| | | | | | | | We no longer use this anywhere, so ditch it.
* | Redesign keepservingAldo Cortesi2018-05-024-22/+43
| | | | | | | | | | | | | | | | - Instead of listening for a pseudo-event, we periodically check whether client replay, server replay or file reading is active. - Adjust server replay not to use tick. - Adjust readfile to expose a command to check whether reading is in progress.
* | commands: clarify command call interface, fix web app replayAldo Cortesi2018-05-024-19/+17
| |
* | client replay: expad and consolidate testsAldo Cortesi2018-05-012-76/+105
| |
* | client replay: re-designAldo Cortesi2018-04-306-59/+52
| | | | | | | | | | | | | | | | | | Re-design the way client replay works. Before, we would fire up a thread, replay, wait for the thread to complete, get the next flow, and repeat the procedure. Now, we have one replay thread that starts when the addon starts, which pops flows off a thread-safe queue. This is much cleaner, removes the need for busy tick, and sets the scene for optimisations like server connection reuse down the track.
* | client replay: move all client replay-related code into addonAldo Cortesi2018-04-275-85/+82
| |
* | Merge pull request #3078 from kajojify/expanduserAldo Cortesi2018-04-261-0/+4
|\ \ | | | | | | Fix #3002. Auto-expanding for tilda.
| * | Fix #3002. Auto-expandingMiroslav2018-04-261-0/+4
| | |
* | | Merge pull request #3071 from cortesi/ticklessAldo Cortesi2018-04-2638-268/+293
|\ \ \ | |/ / |/| | asyncio: shift script reloading out of the tick event
| * | test: shift test_data out of our public APIAldo Cortesi2018-04-2332-225/+216
| | |
| * | addons/script: improve relability of reload testAldo Cortesi2018-04-233-5/+11
| | | | | | | | | | | | | | | | | | The granularity of mtime is surprisingly bad. Make the tests more robust against this, and promote has_log back to a public method, now that we have a few legitimate examples.
| * | asyncio: shift script reloading out of the tick eventAldo Cortesi2018-04-239-52/+80
| | | | | | | | | | | | | | | | | | | | | The tick event is a nasty compromise, left over from when we didn't have an event loop. This is the first patch in a series that explores moving our built-in addons to managing coroutines on the eventloop directly for periodic tasks.
* | | fix pytest invocation errorsMaximilian Hils2018-04-253-3/+3
|/ /
* | Ignore signal errors on windows + various fixesAldo Cortesi2018-04-171-4/+5
| | | | | | | | | | | | | | | | - Ignore the NotImplementedError raised by add_signal_handler on Windows. - Entrypoints return an integer exit code, or None. Adjust our type annotations and code to suit. Fixes #3061
* | asyncio: clarify shutdown semanticsAldo Cortesi2018-04-164-20/+13
| | | | | | | | | | This patch clarifies proxy shutdown, and specifies that the master.shutdown() method is thread-save.
* | Clean up test/helper_tools directoryAldo Cortesi2018-04-165-51323/+0
| |
* | Improve benchmarkingAldo Cortesi2018-04-167-75/+64
|/ | | | | | | | | - The benchmark addon now manages setting up and tearing down the backend and traffic processes itself. - Use wrk instead of hey. I get more consistent results with this tool, and hey shows a strange tail-latency bump that seems artificial. - Make termination behaviour simpler. The bencmark revealed a bug where .done events were not called if the proxy was shut down by an addon.
* Merge pull request #3059 from obscure76/enh/issue-3053Aldo Cortesi2018-04-161-1/+1
|\ | | | | fix Python 3.6 variable type annotations #3053
| * fix Python 3.6 variable type annotations #3053oscure762018-04-141-1/+1
| |
* | Merge pull request #3050 from kira0204/error-scriptAldo Cortesi2018-04-152-7/+23
|\ \ | | | | | | Handling user script's exceptions, fix #2839
| * | Handling user script exceptions, fix #2839kira02042018-04-102-7/+23
| |/
* / readfile: add a readfile_filter optionAldo Cortesi2018-04-141-39/+55
|/ | | | | | * Add a readfile_filter option that filters flows on read. * Adjust test suite for asyncio. * Add asynctest as a dev dependency.
* asyncio: ditch the handler contextAldo Cortesi2018-04-072-2/+4
| | | | | | | There are a few reasons for this. First, logs are now async, and can be called at any time. Second, the event loop is thread local, so there can only ever be one master per thread. These two things together completely obviate the need for a handler context.
* asyncio: remove master.add_log, in favor of a persistent log.Log instanceAldo Cortesi2018-04-071-1/+1
|
* asyncio: remove test master.has_logAldo Cortesi2018-04-076-28/+38
| | | | | Now that logs are async, using this call is almost always a mistake. Signal this by making it semi-private. The method may go away entirely down the track.
* asyncio: move log mechanism onto the event loopAldo Cortesi2018-04-0717-91/+114
| | | | | | Logs are now asynchronous, with a log entry pushed onto the event loop for handling. To support this, the test mechanism grows an await_log method that waits for a log entry to appear.
* asyncio simplify: we don't need a queue for proxy->main loop commsAldo Cortesi2018-04-078-63/+65
| | | | Instead, we just schedule coroutines directly onto the core loop.
* asyncio: remove last vestiage of channel input from masterAldo Cortesi2018-04-071-10/+9
|
* Merge pull request #3031 from itzikBraun/add-httpie-exportAldo Cortesi2018-04-061-1/+29
|\ | | | | added option to export request as httpie command
| * added option to export request as httpie commanditzikBraun2018-04-021-1/+29
| |
* | Merge pull request #2971 from kira0204/user-script-exceptionAldo Cortesi2018-04-061-3/+15
|\ \ | | | | | | A unified handler for user's scripts exception
| * | use error handler functionkira02042018-03-261-3/+3
| | |
| * | User script exception handler[squash]kira02042018-03-071-0/+12
| | | | | | | | | | | | | | | | | | fixing 2837, added test unified-function deleting the wrong commit
* | | fix http retry timeoutMaximilian Hils2018-04-051-38/+6
| | | | | | | | | | | | this fixes #3038
* | | minor fixesAldo Cortesi2018-04-032-10/+4
| | |
* | | asyncio: factor out test server startup waitAldo Cortesi2018-04-033-12/+7
| | |
* | | asyncio: cleanup and lintAldo Cortesi2018-04-022-2/+7
| | | | | | | | | | | | Also fix a racy websocket test.
* | | asyncio: test cleanupAldo Cortesi2018-04-023-8/+18
| | | | | | | | | | | | | | | | | | Also silence asyncio logs. We sometimes end up with messages on the queue that need to be ignored when the proxy shuts down, and asyncio complains loudly about this.
* | | asyncio: make http2 tests passAldo Cortesi2018-04-022-2/+6
| | |
* | | asyncio: fix a few remaining issues in proxy/test_server.pyAldo Cortesi2018-04-022-9/+14
| | |
* | | asyncio: fix channel interface and testsAldo Cortesi2018-04-012-19/+23
| | | | | | | | | | | | | | | We now need to synthesize a tick event when changing addons in tests, because tick is asynchronously called on the event loop.
* | | asyncio: start a test loop for unit testsAldo Cortesi2018-04-012-11/+3
| | | | | | | | | | | | | | | Also move signal handling out of master. These only work in the main thread, and properly belong in main.py.
* | | asyncio: clean up event loop acquisitionAldo Cortesi2018-04-011-80/+9
| | | | | | | | | | | | | | | | | | | | | We now acquire the event loop through asyncio.get_event_loop, avoiding having to pass the loop explicity in a bunch of places. This function does not return the currently running loop from within coroutines in versions of Python prior to 3.6.
* | | asyncio: brutally rip out our old queue mechanismAldo Cortesi2018-04-016-97/+106
| |/ |/|
* | Python 3.5 is dead -- long live Python 3.6!Thomas Kriechbaumer2018-03-313-19/+4
| | | | | | | | fixes #2266
* | fix Tornado 5.0 event loopThomas Kriechbaumer2018-03-241-0/+4
| | | | | | | | https://github.com/tornadoweb/tornado/issues/2183#issuecomment-371001254