Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-pages.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorfeistel <6742251-feistel@users.noreply.gitlab.com>2021-07-27 17:55:52 +0300
committerfeistel <6742251-feistel@users.noreply.gitlab.com>2021-08-17 14:59:53 +0300
commit175480a53dffabf59840e126570a8844fd0047e7 (patch)
treea633e0b99cd664e87429d05a48897b9c3ff10d1b /test
parentd18f89a1da3091bb41b6954923576416f833ab93 (diff)
test: remove status-not-yet-ready test
Since api polling has been removed the gitlab client is always ready, hence the app's statuscheck will never fail
Diffstat (limited to 'test')
-rw-r--r--test/acceptance/helpers_test.go28
-rw-r--r--test/acceptance/status_test.go29
2 files changed, 0 insertions, 57 deletions
diff --git a/test/acceptance/helpers_test.go b/test/acceptance/helpers_test.go
index b75add4b..c1074230 100644
--- a/test/acceptance/helpers_test.go
+++ b/test/acceptance/helpers_test.go
@@ -514,34 +514,6 @@ func ClientWithConfig(tlsConfig *tls.Config) (*http.Client, func()) {
return client, tr.CloseIdleConnections
}
-func waitForRoundtrips(t *testing.T, listeners []ListenSpec, timeout time.Duration) {
- nListening := 0
- start := time.Now()
- for _, spec := range listeners {
- for time.Since(start) < timeout {
- req, err := http.NewRequest("GET", spec.URL("/"), nil)
- if err != nil {
- t.Fatal(err)
- }
-
- client := QuickTimeoutHTTPSClient
- if spec.Type == "https-proxyv2" {
- client = QuickTimeoutProxyv2Client
- }
-
- if response, err := client.Transport.RoundTrip(req); err == nil {
- nListening++
- response.Body.Close()
- break
- }
-
- time.Sleep(100 * time.Millisecond)
- }
- }
-
- require.Equal(t, len(listeners), nListening, "all listeners must be accepting TCP connections")
-}
-
type stubOpts struct {
m sync.RWMutex
apiCalled bool
diff --git a/test/acceptance/status_test.go b/test/acceptance/status_test.go
index 59e7bc17..ef01c692 100644
--- a/test/acceptance/status_test.go
+++ b/test/acceptance/status_test.go
@@ -3,7 +3,6 @@ package acceptance_test
import (
"net/http"
"testing"
- "time"
"github.com/stretchr/testify/require"
)
@@ -19,31 +18,3 @@ func TestStatusPage(t *testing.T) {
defer rsp.Body.Close()
require.Equal(t, http.StatusOK, rsp.StatusCode)
}
-
-func TestStatusNotYetReady(t *testing.T) {
- listeners := supportedListeners()
-
- RunPagesProcess(t,
- withoutWait,
- withExtraArgument("pages-status", "/@statuscheck"),
- withExtraArgument("pages-root", "../../shared/invalid-pages"),
- withStubOptions(&stubOpts{
- statusReadyCount: 100,
- }),
- )
-
- waitForRoundtrips(t, listeners, time.Duration(len(listeners))*time.Second)
-
- // test status on all supported listeners
- for _, spec := range listeners {
- rsp, err := GetPageFromListener(t, spec, "group.gitlab-example.com", "@statuscheck")
- require.NoError(t, err)
- defer rsp.Body.Close()
- require.Equal(t, http.StatusServiceUnavailable, rsp.StatusCode)
-
- rsp2, err2 := GetPageFromListener(t, httpListener, "group.gitlab-example.com", "index.html")
- require.NoError(t, err2)
- defer rsp2.Body.Close()
- require.Equal(t, http.StatusServiceUnavailable, rsp2.StatusCode, "page should not be served")
- }
-}