Skip to content

Commit 96ca146

Browse files
committed
fixing test
1 parent bbe07a5 commit 96ca146

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

test/DotNetWorkerTests/Diagnostics/GrpcHostLoggerTests.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ public async Task UserLog()
4949
public async Task SystemLog_WithException_AndScope()
5050
{
5151
var logger = _provider.CreateLogger("TestLogger");
52+
Exception thrownException = null;
5253

5354
using (logger.BeginScope(new FunctionInvocationScope("MyFunction", "MyInvocationId")))
5455
{
@@ -61,6 +62,7 @@ public async Task SystemLog_WithException_AndScope()
6162
// The only way to log a system log.
6263
var log = WorkerMessage.Define<string>(LogLevel.Trace, new EventId(1, "One"), "system log with {param}");
6364
log(logger, "this", ex);
65+
thrownException = ex;
6466
}
6567

6668
// make sure this is now user
@@ -84,7 +86,7 @@ public async Task SystemLog_WithException_AndScope()
8486
Assert.Equal("system log with this", p.RpcLog.Message);
8587
Assert.Equal("One", p.RpcLog.EventId);
8688
Assert.Equal("MyInvocationId", p.RpcLog.InvocationId);
87-
Assert.Equal("System.InvalidOperationException: boom", p.RpcLog.Exception.Message);
89+
Assert.Equal(thrownException.ToString(), p.RpcLog.Exception.Message);
8890
Assert.Equal("Microsoft.Azure.Functions.Worker.Tests", p.RpcLog.Exception.Source);
8991
Assert.Contains(nameof(SystemLog_WithException_AndScope), p.RpcLog.Exception.StackTrace);
9092
},

0 commit comments

Comments
 (0)