Skip to content

Commit b781b27

Browse files
committed
adding more test logging
1 parent 5641b43 commit b781b27

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

test/WebJobs.Script.Tests.Integration/Host/ScriptHostManagerTests.cs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ public async Task RenameFunctionAndRestart()
128128
var fixture = new NodeEndToEndTests.TestFixture();
129129
await fixture.Host.StopAsync();
130130
var config = fixture.Host.ScriptConfig;
131+
List<string> pollMessages = new List<string>();
131132

132133
var blob = fixture.TestOutputContainer.GetBlockBlobReference("testblob");
133134

@@ -151,14 +152,16 @@ public async Task RenameFunctionAndRestart()
151152
try
152153
{
153154
// don't start until the manager is running
154-
TestHelpers.Await(() => manager.State == ScriptHostState.Running).Wait();
155+
TestHelpers.Await(() => manager.State == ScriptHostState.Running,
156+
userMessage: "Host did not start in time.").Wait();
155157

156158
// Wait for initial execution.
157159
TestHelpers.Await(() =>
158160
{
159161
bool exists = blob.Exists();
162+
pollMessages.Add($"TimerTrigger: [{DateTime.UtcNow.ToString("HH:mm:ss.fff")}] '{blob.Uri}' exists: {exists}");
160163
return exists;
161-
}, timeout: 10 * 1000).Wait();
164+
}, timeout: 10 * 1000, userMessage: $"Blob '{blob.Uri}' was not created by 'TimerTrigger' in time.").Wait();
162165

163166
// find __dirname from blob
164167
string text;
@@ -181,8 +184,9 @@ public async Task RenameFunctionAndRestart()
181184
TestHelpers.Await(() =>
182185
{
183186
bool exists = blob.Exists();
187+
pollMessages.Add($"MovedTrigger: [{DateTime.UtcNow.ToString("HH:mm:ss.fff")}] '{blob.Uri}' exists: {exists}");
184188
return exists;
185-
}, timeout: 30 * 1000).Wait();
189+
}, timeout: 30 * 1000, userMessage: $"Blob '{blob.Uri}' was not created by 'MovedTrigger' in time.").Wait();
186190

187191
using (var stream = new MemoryStream())
188192
{
@@ -218,7 +222,8 @@ public async Task RenameFunctionAndRestart()
218222
Assert.True(t.Join(TimeSpan.FromSeconds(10)), "Thread join timed out.");
219223

220224
Assert.False(timeout, "The test timed out and was canceled.");
221-
Assert.True(exception == null, exception?.SourceException?.ToString());
225+
string pollString = string.Join(Environment.NewLine, pollMessages);
226+
Assert.True(exception == null, pollString + Environment.NewLine + exception?.SourceException?.ToString());
222227
Assert.True(moveException == null, "Failed to move function back to original directory: " + moveException?.SourceException?.ToString());
223228
}
224229
}

0 commit comments

Comments
 (0)