locked
Creating throttling exception for testing RRS feed

  • Question

  • How can we create a throttling exception easily, in a cost effective manner, in sql azure? This is to test the TransientFaultHandling libraries in windows azure.

    Wednesday, August 22, 2012 2:43 PM

Answers

  • found a way to test code using transient framework with out generating a genuine throttling exception.
    Create a mock class derived from ITransientErrorDetectionStrategy and return true. Use this class in           
    var retryPolicy = new RetryPolicy<MockClass>(retryStrategy);
      That is it! for more ...
    • Marked as answer by Blue Clouds Saturday, August 25, 2012 5:47 PM
    • Unmarked as answer by Blue Clouds Saturday, August 25, 2012 6:17 PM
    • Edited by Blue Clouds Saturday, August 25, 2012 6:21 PM
    • Marked as answer by Blue Clouds Saturday, August 25, 2012 6:21 PM
    Saturday, August 25, 2012 5:47 PM

All replies

  • Hi Blue Clouds,

    Quick suggestion:

    Create and open a considerable amount of SQL Connections and perform some basic SQL commands (ie: SELECT TOP 1 id FROM tableXYZ). Leave the SQL connections open or leave them idling (try have this done using multiple threads or starting multiple worker/web roles instances from your Azure Emulator is simpler) . You'll probably hit on one of these constraints. You should be able to test some of your TransientFaultHandling policies.

    Hope this helps!

     


    Best Regards,
    Carlos Sardo




    Wednesday, August 22, 2012 3:45 PM
  • found a way to test code using transient framework with out generating a genuine throttling exception.
    Create a mock class derived from ITransientErrorDetectionStrategy and return true. Use this class in           
    var retryPolicy = new RetryPolicy<MockClass>(retryStrategy);
      That is it! for more ...
    • Marked as answer by Blue Clouds Saturday, August 25, 2012 5:47 PM
    • Unmarked as answer by Blue Clouds Saturday, August 25, 2012 6:17 PM
    • Edited by Blue Clouds Saturday, August 25, 2012 6:21 PM
    • Marked as answer by Blue Clouds Saturday, August 25, 2012 6:21 PM
    Saturday, August 25, 2012 5:47 PM