Skip to content

Commit 1a84fb8

Browse files
committed
Fixing flaky test
1 parent a18c301 commit 1a84fb8

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

src/WebJobs.Script/Description/CSharp/CSharpFunctionSignature.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ public override bool Equals(object obj)
111111

112112
public override int GetHashCode()
113113
{
114-
return string.Join("<>", _parameters.Select(p=>GetParameterIdentityString(p)))
114+
return string.Join("<>", _parameters.Select(p => GetParameterIdentityString(p)))
115115
.GetHashCode();
116116
}
117117

test/WebJobs.Script.Tests/SamplesEndToEndTests.cs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,27 @@ public TestFixture()
9090
HttpServer server = new HttpServer(config);
9191
this.Client = new HttpClient(server);
9292
this.Client.BaseAddress = new Uri("https://localhost/");
93+
94+
WaitForHost();
9395
}
9496

9597
public HttpClient Client { get; set; }
98+
99+
private void WaitForHost()
100+
{
101+
TestHelpers.Await(() =>
102+
{
103+
return IsHostRunning();
104+
}).Wait();
105+
}
106+
107+
private bool IsHostRunning()
108+
{
109+
HttpRequestMessage request = new HttpRequestMessage(HttpMethod.Get, string.Empty);
110+
111+
HttpResponseMessage response = this.Client.SendAsync(request).Result;
112+
return response.StatusCode == HttpStatusCode.NoContent;
113+
}
96114
}
97115
}
98116
}

0 commit comments

Comments
 (0)