basho/riak_test — pull request #354 by bowrocker (2013-08-16 13:29:22+00:00)
Title: Test for RTQ mailbox overload handling

#### Related PR

https://github.com/basho/riak_repl/pull/372

#### Description

This test attempts to force overload handling to turn on both by configuring the sink with few resources (max_workers, max_pending = 1), and by introducing a run-once intercept on trim_q/1 on the source RTQ that introduces a long sleep. This gives time for the mailbox on the source RTQ to start to back up with traffic running, initiate overload handling, and dropping some pushe messages. On subsequent calls to the intercept, no sleep is done, so the backlog should drain.

Reads from the sink should reflect the drops. The test checks to make sure there are *some* drops (it does not do exact accounting), and displays the message_queue size on the source while the test is running, for visual inspection.