Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ internal void OnRaiseProgressEvent(WriteObjectProgressArgs progressArgs)
/// <param name="args">DownloadInitiatedEventArgs args</param>
internal void OnRaiseTransferInitiatedEvent(DownloadInitiatedEventArgs args)
{
AWSSDKUtils.InvokeInBackground(DownloadInitiatedEvent, args, this);
DownloadInitiatedEvent?.Invoke(this, args);
}

/// <summary>
Expand All @@ -202,7 +202,7 @@ internal void OnRaiseTransferInitiatedEvent(DownloadInitiatedEventArgs args)
/// <param name="args">DownloadCompletedEventArgs args</param>
internal void OnRaiseTransferCompletedEvent(DownloadCompletedEventArgs args)
{
AWSSDKUtils.InvokeInBackground(DownloadCompletedEvent, args, this);
DownloadCompletedEvent?.Invoke(this, args);
}

/// <summary>
Expand All @@ -211,7 +211,7 @@ internal void OnRaiseTransferCompletedEvent(DownloadCompletedEventArgs args)
/// <param name="args">DownloadFailedEventArgs args</param>
internal void OnRaiseTransferFailedEvent(DownloadFailedEventArgs args)
{
AWSSDKUtils.InvokeInBackground(DownloadFailedEvent, args, this);
DownloadFailedEvent?.Invoke(this, args);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ internal bool IsSetPartSize()
/// <param name="args">UploadInitiatedEventArgs args</param>
internal void OnRaiseTransferInitiatedEvent(UploadInitiatedEventArgs args)
{
AWSSDKUtils.InvokeInBackground(UploadInitiatedEvent, args, this);
UploadInitiatedEvent?.Invoke(this, args);
}

/// <summary>
Expand All @@ -285,7 +285,7 @@ internal void OnRaiseTransferInitiatedEvent(UploadInitiatedEventArgs args)
/// <param name="args">UploadCompletedEventArgs args</param>
internal void OnRaiseTransferCompletedEvent(UploadCompletedEventArgs args)
{
AWSSDKUtils.InvokeInBackground(UploadCompletedEvent, args, this);
UploadCompletedEvent?.Invoke(this, args);
}

/// <summary>
Expand All @@ -294,7 +294,7 @@ internal void OnRaiseTransferCompletedEvent(UploadCompletedEventArgs args)
/// <param name="args">UploadFailedEventArgs args</param>
internal void OnRaiseTransferFailedEvent(UploadFailedEventArgs args)
{
AWSSDKUtils.InvokeInBackground(UploadFailedEvent, args, this);
UploadFailedEvent?.Invoke(this, args);
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2125,11 +2125,7 @@ public void AssertEventFired()
if (EventException != null)
throw EventException;

// Since AWSSDKUtils.InvokeInBackground fires the event in the background it is possible that we check too early that the event has fired. In this case, we sleep and check again.
for (int retries = 1; retries < 5 && !EventFired; retries++)
{
Thread.Sleep(1000 * retries);
}
// Since events are now fired synchronously, we can check immediately without retries
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this function was only used for validating the non in progress events. theres a separate function that validates the in progress once which still has the retry logic since its a background thread

Assert.IsTrue(EventFired, $"{typeof(T).Name} event was not fired");
}
}
Expand Down