Skip to content

Commit

Permalink
[Event Hubs Client] Fix Live Test Hangs (#17132)
Browse files Browse the repository at this point in the history
The focus of these changes is to triage the test hangs in the live suite
that seem to be related to the snippet smoke tests.   This should unblock
test runs while I continue to troubleshoot and locate the root cause.
  • Loading branch information
jsquire authored Nov 21, 2020
1 parent 215a576 commit 620a140
Show file tree
Hide file tree
Showing 18 changed files with 24 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ namespace Azure.Messaging.EventHubs.Tests.Snippets
/// </summary>
///
[TestFixture]
[Ignore("Debugging Potential Hang")]
[Category(TestCategory.Live)]
[Category(TestCategory.DisallowVisualStudioLiveUnitTesting)]
[SuppressMessage("Style", "IDE0059:Unnecessary assignment of a value", Justification = "Example assignments needed for snippet output content.")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ namespace Azure.Messaging.EventHubs.Tests.Snippets
/// </summary>
///
[TestFixture]
[Ignore("Debugging Potential Hang")]
[Category(TestCategory.Live)]
[Category(TestCategory.DisallowVisualStudioLiveUnitTesting)]
[SuppressMessage("Style", "IDE0059:Unnecessary assignment of a value", Justification = "Example assignments needed for snippet output content.")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ namespace Azure.Messaging.EventHubs.Tests.Snippets
/// </summary>
///
[TestFixture]
[Ignore("Debugging Potential Hang")]
[Category(TestCategory.Live)]
[Category(TestCategory.DisallowVisualStudioLiveUnitTesting)]
[SuppressMessage("Style", "IDE0059:Unnecessary assignment of a value", Justification = "Example assignments needed for snippet output content.")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ namespace Azure.Messaging.EventHubs.Tests.Snippets
/// </summary>
///
[TestFixture]
[Ignore("Debugging Potential Hang")]
[Category(TestCategory.Live)]
[Category(TestCategory.DisallowVisualStudioLiveUnitTesting)]
[SuppressMessage("Style", "IDE0059:Unnecessary assignment of a value", Justification = "Example assignments needed for snippet output content.")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ namespace Azure.Messaging.EventHubs.Tests.Snippets
/// </summary>
///
[TestFixture]
[Ignore("Debugging Potential Hang")]
[Category(TestCategory.Live)]
[Category(TestCategory.DisallowVisualStudioLiveUnitTesting)]
[SuppressMessage("Style", "IDE0059:Unnecessary assignment of a value", Justification = "Example assignments needed for snippet output content.")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ namespace Azure.Messaging.EventHubs.Tests.Snippets
/// </summary>
///
[TestFixture]
[Ignore("Debugging Potential Hang")]
[Category(TestCategory.Live)]
[Category(TestCategory.DisallowVisualStudioLiveUnitTesting)]
[SuppressMessage("Style", "IDE0059:Unnecessary assignment of a value", Justification = "Example assignments needed for snippet output content.")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ namespace Azure.Messaging.EventHubs.Tests.Snippets
/// </summary>
///
[TestFixture]
[Ignore("Debugging Potential Hang")]
[Category(TestCategory.Live)]
[Category(TestCategory.DisallowVisualStudioLiveUnitTesting)]
[SuppressMessage("Style", "IDE0059:Unnecessary assignment of a value", Justification = "Example assignments needed for snippet output content.")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -895,16 +895,16 @@ public async Task ConsumerCannotReadWhenClosed()
var partition = (await consumer.GetPartitionIdsAsync(cancellationSource.Token)).First();
await SendEventsAsync(connectionString, sourceEvents, new CreateBatchOptions { PartitionId = partition }, cancellationSource.Token);

// Read the events and validate the resulting state.

// Create a local function that will close the consumer after five events have
// been read.
// been read. Because the close happens in the middle of iteration, allow for a short
// delay to ensure that the state transition has been fully captured.

async Task<bool> closeAfterRead(ReadState state)
{
if (state.Events.Count >= 2)
{
await consumer.CloseAsync(cancellationSource.Token).ConfigureAwait(false);
await consumer.CloseAsync(cancellationSource.Token);
await Task.Delay(250);
}

return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -874,13 +874,15 @@ public async Task ReceiverCannotReadWhenClosed()
await using (var receiver = new PartitionReceiver(EventHubConsumerClient.DefaultConsumerGroupName, partition, EventPosition.Earliest, connectionString))
{
// Create a local function that will close the receiver after five events have
// been read.
// been read. Because the close happens during the read loop, allow for a short
// delay to ensure that the state transition has been fully captured.

async Task<bool> closeAfterFiveRead(ReadState state)
{
if (state.Events.Count >= 2)
{
await receiver.CloseAsync(cancellationSource.Token).ConfigureAwait(false);
await receiver.CloseAsync(cancellationSource.Token);
await Task.Delay(250);
}

return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ namespace Azure.Messaging.EventHubs.Tests.Snippets
/// </summary>
///
[TestFixture]
[Ignore("Debugging Potential Hang")]
[Category(TestCategory.Live)]
[Category(TestCategory.DisallowVisualStudioLiveUnitTesting)]
[SuppressMessage("Style", "IDE0059:Unnecessary assignment of a value", Justification = "Example assignments needed for snippet output content.")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ namespace Azure.Messaging.EventHubs.Tests.Snippets
/// </summary>
///
[TestFixture]
[Ignore("Debugging Potential Hang")]
[Category(TestCategory.Live)]
[Category(TestCategory.DisallowVisualStudioLiveUnitTesting)]
[SuppressMessage("Style", "IDE0059:Unnecessary assignment of a value", Justification = "Example assignments needed for snippet output content.")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ namespace Azure.Messaging.EventHubs.Tests.Snippets
/// </summary>
///
[TestFixture]
[Ignore("Debugging Potential Hang")]
[Category(TestCategory.Live)]
[Category(TestCategory.DisallowVisualStudioLiveUnitTesting)]
[SuppressMessage("Style", "IDE0059:Unnecessary assignment of a value", Justification = "Example assignments needed for snippet output content.")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ namespace Azure.Messaging.EventHubs.Tests.Snippets
/// </summary>
///
[TestFixture]
[Ignore("Debugging Potential Hang")]
[Category(TestCategory.Live)]
[Category(TestCategory.DisallowVisualStudioLiveUnitTesting)]
[SuppressMessage("Style", "IDE0059:Unnecessary assignment of a value", Justification = "Example assignments needed for snippet output content.")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ namespace Azure.Messaging.EventHubs.Tests.Snippets
/// </summary>
///
[TestFixture]
[Ignore("Debugging Potential Hang")]
[Category(TestCategory.Live)]
[Category(TestCategory.DisallowVisualStudioLiveUnitTesting)]
[SuppressMessage("Style", "IDE0059:Unnecessary assignment of a value", Justification = "Example assignments needed for snippet output content.")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ namespace Azure.Messaging.EventHubs.Tests.Snippets
/// </summary>
///
[TestFixture]
[Ignore("Debugging Potential Hang")]
[Category(TestCategory.Live)]
[Category(TestCategory.DisallowVisualStudioLiveUnitTesting)]
[SuppressMessage("Style", "IDE0059:Unnecessary assignment of a value", Justification = "Example assignments needed for snippet output content.")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ namespace Azure.Messaging.EventHubs.Tests.Snippets
/// </summary>
///
[TestFixture]
[Ignore("Debugging Potential Hang")]
[Category(TestCategory.Live)]
[Category(TestCategory.DisallowVisualStudioLiveUnitTesting)]
[SuppressMessage("Style", "IDE0059:Unnecessary assignment of a value", Justification = "Example assignments needed for snippet output content.")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ namespace Azure.Messaging.EventHubs.Tests.Snippets
/// </summary>
///
[TestFixture]
[Ignore("Debugging Potential Hang")]
[Category(TestCategory.Live)]
[Category(TestCategory.DisallowVisualStudioLiveUnitTesting)]
[SuppressMessage("Style", "IDE0059:Unnecessary assignment of a value", Justification = "Example assignments needed for snippet output content.")]
Expand Down
2 changes: 1 addition & 1 deletion sdk/eventhub/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ trigger: none
extends:
template: ../../eng/pipelines/templates/stages/archetype-sdk-tests.yml
parameters:
MaxParallel: 1
MaxParallel: 6
ServiceDirectory: eventhub
TimeoutInMinutes: 130
Clouds: 'Public,Canary'

0 comments on commit 620a140

Please sign in to comment.