title: MassTransit 4 Unit Test Consumer timeout
body: <p>I have successfully used this testing pattern with sagas in MT 3.5.7 but now in MT 4.0 and testing a consumer I am getting a timeout using the <code>InMemoryTestHarness</code> to test publication of a message from a consumer.</p>
  
  <p>Single stepping via test debug I can see the consumer gets invoked correctly and it publishes its message. The consumer does nothing except receive the message and publish a new message.</p>
  
  <p>But awaiting the <code>_harness.SubscribeHandler</code> for the published message is timing out.</p>
  
  <p>For sake of brevity the code below has my container registrations and test data set up removed.</p>
  
  <pre><code>[TestFixture]
  public class ConsumerTest
  {
      InMemoryTestHarness _harness;
      ConsumerTestHarness&lt;TCommandConsumer&gt; _consumer
      ConsumeContext&lt;ConsumerCompleted&gt; _resultHandler;
  
      [OneTimeSetup]
      public async Task TaskSetup()
      {
        IContainer _container;
        //...container registrations and test data setup
  
        _harness = new InMemoryTestHarnes();
        _consumer = _harness.Consumer&lt;TCommandConsumer&gt;( () =&gt; _container.Resolve&lt;TCommandConsumer&gt;() );
        await _harness.Start();
        await _harness.InputQueueSendEndpoint.Send(new TCommand { Source = testdataSource, Topic = testdataTopic });
       _resultHandler = await _harness.SubscribeHandler&lt;ConsumerCompleted&gt;(); //Timeout here
      }
  </code></pre>
  
  <p>The command consumer (<code>TCommandConsumer</code>) successfully receives the command sent from <code>InputQueueSendEndpoint.Send</code> and it publishes its response (<code>ConsumerCompleted</code>) but I can't get that handled in the test fixture.</p>
  
  <p>What am I missing here?</p>