You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: test/WebJobs.Script.Tests/Diagnostics/LinuxContainerEventGeneratorWithConsoleOutputTests.cs
+9-12Lines changed: 9 additions & 12 deletions
Original file line number
Diff line number
Diff line change
@@ -152,14 +152,12 @@ public void MultipleEventsWithTinyBuffer_WritesDirectlyToConsoleOnTimeout(bool b
152
152
varoutput=sr.ReadToEnd().Trim().SplitLines();
153
153
154
154
// The first two messages are still stuck in the buffer. The third message will have been written to the console.
155
-
// We should also have a log for the timeout exception that occurred while waiting for the buffer to become available.
156
-
Assert.Equal(2,output.Length);
157
-
Assert.StartsWith("MS_FUNCTION_LOGS 2,,,,,LogUnhandledException,\"System.OperationCanceledException: The operation was canceled.",output[0]);
158
-
Assert.Equal($"MS_FUNCTION_LOGS 4,C37E3412-86D1-4B93-BC5A-A2AE09D26C2D,TestApp,TestFunction3,TestEvent,TestSource,\"These are the details, lots of details\",\"This is the summary, a great summary\",{ScriptHost.Version},{timestamp.ToString("O")},TestExceptionType,\"Test exception message, with details\",E2D5A6ED-4CE3-4CFD-8878-FD4814F0A1F3,3AD41658-1C4E-4C9D-B0B9-24F2BDAE2829,F0AAA9AD-C3A6-48B9-A75E-57BB280EBB53,TEST-CONTAINER,test-stamp,test-tenant,TestRuntimeSiteName,TestSlotName",output[1]);
155
+
Assert.Equal(1,output.Length);
156
+
Assert.Equal($"MS_FUNCTION_LOGS 4,C37E3412-86D1-4B93-BC5A-A2AE09D26C2D,TestApp,TestFunction3,TestEvent,TestSource,\"These are the details, lots of details\",\"This is the summary, a great summary\",{ScriptHost.Version},{timestamp.ToString("O")},TestExceptionType,\"Test exception message, with details\",E2D5A6ED-4CE3-4CFD-8878-FD4814F0A1F3,3AD41658-1C4E-4C9D-B0B9-24F2BDAE2829,F0AAA9AD-C3A6-48B9-A75E-57BB280EBB53,TEST-CONTAINER,test-stamp,test-tenant,TestRuntimeSiteName,TestSlotName",output[0]);
@@ -170,24 +168,23 @@ public async Task MultipleEventsBatchedWithTinyBuffer_BlocksOnWriteOnBufferFull_
170
168
generator.LogFunctionTraceEvent(LogLevel.Information,"C37E3412-86D1-4B93-BC5A-A2AE09D26C2D","TestApp","TestFunction1","TestEvent","TestSource","These are the details, lots of details","This is the summary, a great summary","TestExceptionType","Test exception message, with details","E2D5A6ED-4CE3-4CFD-8878-FD4814F0A1F3","3AD41658-1C4E-4C9D-B0B9-24F2BDAE2829","F0AAA9AD-C3A6-48B9-A75E-57BB280EBB53","TestRuntimeSiteName","TestSlotName",timestamp);
171
169
generator.LogFunctionTraceEvent(LogLevel.Information,"C37E3412-86D1-4B93-BC5A-A2AE09D26C2D","TestApp","TestFunction2","TestEvent","TestSource","These are the details, lots of details","This is the summary, a great summary","TestExceptionType","Test exception message, with details","E2D5A6ED-4CE3-4CFD-8878-FD4814F0A1F3","3AD41658-1C4E-4C9D-B0B9-24F2BDAE2829","F0AAA9AD-C3A6-48B9-A75E-57BB280EBB53","TestRuntimeSiteName","TestSlotName",timestamp);
172
170
173
-
// The third write will block until the first two are flushed.
174
-
varlogTask=Task.Run(()=>generator.LogFunctionTraceEvent(LogLevel.Information,"C37E3412-86D1-4B93-BC5A-A2AE09D26C2D","TestApp","TestFunction3","TestEvent","TestSource","These are the details, lots of details","This is the summary, a great summary","TestExceptionType","Test exception message, with details","E2D5A6ED-4CE3-4CFD-8878-FD4814F0A1F3","3AD41658-1C4E-4C9D-B0B9-24F2BDAE2829","F0AAA9AD-C3A6-48B9-A75E-57BB280EBB53","TestRuntimeSiteName","TestSlotName",timestamp));
171
+
// The third write will go direct to console
172
+
generator.LogFunctionTraceEvent(LogLevel.Information,"C37E3412-86D1-4B93-BC5A-A2AE09D26C2D","TestApp","TestFunction3","TestEvent","TestSource","These are the details, lots of details","This is the summary, a great summary","TestExceptionType","Test exception message, with details","E2D5A6ED-4CE3-4CFD-8878-FD4814F0A1F3","3AD41658-1C4E-4C9D-B0B9-24F2BDAE2829","F0AAA9AD-C3A6-48B9-A75E-57BB280EBB53","TestRuntimeSiteName","TestSlotName",timestamp);
Assert.Equal($"MS_FUNCTION_LOGS 4,C37E3412-86D1-4B93-BC5A-A2AE09D26C2D,TestApp,TestFunction1,TestEvent,TestSource,\"These are the details, lots of details\",\"This is the summary, a great summary\",{ScriptHost.Version},{timestamp.ToString("O")},TestExceptionType,\"Test exception message, with details\",E2D5A6ED-4CE3-4CFD-8878-FD4814F0A1F3,3AD41658-1C4E-4C9D-B0B9-24F2BDAE2829,F0AAA9AD-C3A6-48B9-A75E-57BB280EBB53,TEST-CONTAINER,test-stamp,test-tenant,TestRuntimeSiteName,TestSlotName",output[0]);
189
-
Assert.Equal($"MS_FUNCTION_LOGS 4,C37E3412-86D1-4B93-BC5A-A2AE09D26C2D,TestApp,TestFunction2,TestEvent,TestSource,\"These are the details, lots of details\",\"This is the summary, a great summary\",{ScriptHost.Version},{timestamp.ToString("O")},TestExceptionType,\"Test exception message, with details\",E2D5A6ED-4CE3-4CFD-8878-FD4814F0A1F3,3AD41658-1C4E-4C9D-B0B9-24F2BDAE2829,F0AAA9AD-C3A6-48B9-A75E-57BB280EBB53,TEST-CONTAINER,test-stamp,test-tenant,TestRuntimeSiteName,TestSlotName",output[1]);
190
-
Assert.Equal($"MS_FUNCTION_LOGS 4,C37E3412-86D1-4B93-BC5A-A2AE09D26C2D,TestApp,TestFunction3,TestEvent,TestSource,\"These are the details, lots of details\",\"This is the summary, a great summary\",{ScriptHost.Version},{timestamp.ToString("O")},TestExceptionType,\"Test exception message, with details\",E2D5A6ED-4CE3-4CFD-8878-FD4814F0A1F3,3AD41658-1C4E-4C9D-B0B9-24F2BDAE2829,F0AAA9AD-C3A6-48B9-A75E-57BB280EBB53,TEST-CONTAINER,test-stamp,test-tenant,TestRuntimeSiteName,TestSlotName",output[2]);
184
+
// the log from TestFunction3 will be first because it was written directly to the console
185
+
Assert.Equal($"MS_FUNCTION_LOGS 4,C37E3412-86D1-4B93-BC5A-A2AE09D26C2D,TestApp,TestFunction3,TestEvent,TestSource,\"These are the details, lots of details\",\"This is the summary, a great summary\",{ScriptHost.Version},{timestamp.ToString("O")},TestExceptionType,\"Test exception message, with details\",E2D5A6ED-4CE3-4CFD-8878-FD4814F0A1F3,3AD41658-1C4E-4C9D-B0B9-24F2BDAE2829,F0AAA9AD-C3A6-48B9-A75E-57BB280EBB53,TEST-CONTAINER,test-stamp,test-tenant,TestRuntimeSiteName,TestSlotName",output[0]);
186
+
Assert.Equal($"MS_FUNCTION_LOGS 4,C37E3412-86D1-4B93-BC5A-A2AE09D26C2D,TestApp,TestFunction1,TestEvent,TestSource,\"These are the details, lots of details\",\"This is the summary, a great summary\",{ScriptHost.Version},{timestamp.ToString("O")},TestExceptionType,\"Test exception message, with details\",E2D5A6ED-4CE3-4CFD-8878-FD4814F0A1F3,3AD41658-1C4E-4C9D-B0B9-24F2BDAE2829,F0AAA9AD-C3A6-48B9-A75E-57BB280EBB53,TEST-CONTAINER,test-stamp,test-tenant,TestRuntimeSiteName,TestSlotName",output[1]);
187
+
Assert.Equal($"MS_FUNCTION_LOGS 4,C37E3412-86D1-4B93-BC5A-A2AE09D26C2D,TestApp,TestFunction2,TestEvent,TestSource,\"These are the details, lots of details\",\"This is the summary, a great summary\",{ScriptHost.Version},{timestamp.ToString("O")},TestExceptionType,\"Test exception message, with details\",E2D5A6ED-4CE3-4CFD-8878-FD4814F0A1F3,3AD41658-1C4E-4C9D-B0B9-24F2BDAE2829,F0AAA9AD-C3A6-48B9-A75E-57BB280EBB53,TEST-CONTAINER,test-stamp,test-tenant,TestRuntimeSiteName,TestSlotName",output[2]);
0 commit comments