chore: move workspace apps tests to new package (#7025)

* chore: move workspace apps tests to new package
* chore: move reconnecting pty to apptest package
This commit is contained in:
Dean Sheather
2023-04-06 16:35:27 -05:00
committed by GitHub
parent b2892c3d17
commit 5398150c25
7 changed files with 1609 additions and 1530 deletions
-17
View File
@@ -14,23 +14,6 @@ import (
// While running tests in parallel, the web server seems to be overloaded and responds with HTTP 502.
// require.Eventually expects correct HTTP responses.
func doWithRetries(t require.TestingT, client *codersdk.Client, req *http.Request) (*http.Response, error) {
var resp *http.Response
var err error
require.Eventually(t, func() bool {
// nolint // only requests which are not passed upstream have a body closed
resp, err = client.HTTPClient.Do(req)
if resp != nil && resp.StatusCode == http.StatusBadGateway {
if resp.Body != nil {
resp.Body.Close()
}
return false
}
return true
}, testutil.WaitLong, testutil.IntervalFast)
return resp, err
}
func requestWithRetries(ctx context.Context, t require.TestingT, client *codersdk.Client, method, path string, body interface{}, opts ...codersdk.RequestOption) (*http.Response, error) {
var resp *http.Response
var err error