Skip to content
Merged
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
9 changes: 5 additions & 4 deletions sdk/test/Services/S3/IntegrationTests/TransferUtilityTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -909,7 +909,7 @@ public void MultipartUploadUnseekableStreamCompletedEventTest()
Assert.IsNotNull(args.Request);
Assert.IsNotNull(args.Response);
Assert.AreEqual(-1, args.TotalBytes); // Unseekable streams have unknown length
Assert.AreEqual(20 * MEG_SIZE, args.TransferredBytes); // since we know the actual length via testing it, we can check the transferredbytes size
Assert.AreEqual(0, args.TransferredBytes); // unseekable streams we dont attach and progress listeners so we wont have transferredbytes.
}
};
UploadUnseekableStreamWithLifecycleEvents(20 * MEG_SIZE, null, eventValidator, null);
Expand Down Expand Up @@ -964,7 +964,7 @@ public void MultipartUploadUnseekableStreamCompleteLifecycleTest()
Assert.IsNotNull(args.Request);
Assert.IsNotNull(args.Response);
Assert.AreEqual(-1, args.TotalBytes); // Unseekable streams have unknown length
Assert.AreEqual(18 * MEG_SIZE, args.TransferredBytes); // Should have transferred all bytes
Assert.AreEqual(0, args.TransferredBytes); // unseekable streams we dont attach and progress listeners so we wont have transferredbytes.
}
};

Expand Down Expand Up @@ -1758,15 +1758,16 @@ public void OnEventFired(object sender, T eventArgs)
{
try
{
EventFired = true;
Console.WriteLine("Lifecycle Event Fired: {0}", typeof(T).Name);
Validate?.Invoke(eventArgs);
EventFired = true; // Only set if validation passes
Copy link
Contributor Author

@GarrettBeatty GarrettBeatty Oct 23, 2025

Choose a reason for hiding this comment

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

with this change, i reran the tests and they actually fail now if there is some assertion error. and then once i made the above updates to the test cases they now pass

}
catch (Exception ex)
{
EventException = ex;
EventFired = false; // Ensure we don't mark as fired on failure
Console.WriteLine("Exception caught in lifecycle event: {0}", ex.Message);
throw;
// Don't re-throw, let AssertEventFired() handle it
}
}

Expand Down