Skip to content

Commit

Permalink
[TT-1001] Loosen Runtime CI assumptions on devtools behavior (#10499)
Browse files Browse the repository at this point in the history
  • Loading branch information
Domiii authored Apr 23, 2024
1 parent d3def23 commit 28324e5
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions packages/e2e-tests/scripts/buildkite_run_fe_tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,17 +142,16 @@ function githubUrlToRepository(url) {
return url?.replace(/.*github.com[:\/](.*)\.git/, "$1");
}

function waitForHTTPStatus(
function testHttpConnection(
url: string,
statusCode: number = 200, // by default we wait for OK
timeoutMs = 15000, // keep waiting for 15s total
retryTime = 1000 // retry after 1s
timeoutMs = 15000 // keep waiting for 15s total
): Promise<void> {
const startTime = Date.now();
return new Promise((resolve, reject) => {
function attemptConnection() {
const request = http.get(url, res => {
if (res.statusCode === statusCode) {
const request = http.get(url, async res => {
if (res.statusCode < 500) {
// As long as we can connect at all, we should be fine.
resolve();
return;
}
Expand Down Expand Up @@ -259,7 +258,7 @@ export default async function run_fe_tests(

// make sure the dev server is up and running.
console.log("waiting for dev server to start up");
await waitForHTTPStatus("http://localhost:8080/");
await testHttpConnection("http://localhost:8080/");
console.log("dev server up, continuing with test");
}

Expand Down

0 comments on commit 28324e5

Please sign in to comment.