Skip to content

Commit bef65bc

Browse files
authored
Merge pull request #2350 from josephschorr/test-http-readonly-flake
Disable test of readonly serve-test, as it is making the test server …
2 parents e2094f0 + 6557dd3 commit bef65bc

File tree

1 file changed

+15
-14
lines changed

1 file changed

+15
-14
lines changed

cmd/spicedb/servetesting_integration_test.go

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,8 @@ import (
88
"context"
99
"fmt"
1010
"io"
11-
"io/ioutil"
1211
"log"
1312
"net/http"
14-
"strings"
1513
"testing"
1614
"time"
1715

@@ -43,7 +41,7 @@ func TestTestServer(t *testing.T) {
4341
"--http-addr", ":8443",
4442
"--readonly-http-addr", ":8444",
4543
"--http-enabled",
46-
"--readonly-http-enabled",
44+
//"--readonly-http-enabled",
4745
},
4846
ExposedPorts: []string{"50051/tcp", "50052/tcp", "8443/tcp", "8444/tcp"},
4947
},
@@ -158,17 +156,20 @@ func TestTestServer(t *testing.T) {
158156
require.Contains(string(body), "schemaText")
159157
require.Contains(string(body), "definition resource")
160158

161-
// Attempt to write to the read only HTTP and ensure it fails.
162-
writeUrl := fmt.Sprintf("http://localhost:%s/v1/schema/write", tester.readonlyHttpPort)
163-
wresp, err := http.Post(writeUrl, "application/json", strings.NewReader(`{
164-
"schemaText": "definition user {}\ndefinition resource {\nrelation reader: user\nrelation writer: user\nrelation foobar: user\n}"
165-
}`))
166-
require.NoError(err)
167-
require.Equal(503, wresp.StatusCode)
168-
169-
body, err = ioutil.ReadAll(wresp.Body)
170-
require.NoError(err)
171-
require.Contains(string(body), "SERVICE_READ_ONLY")
159+
/*
160+
* TODO(jschorr): Re-enable once we figure out why this makes the test flaky
161+
// Attempt to write to the read only HTTP and ensure it fails.
162+
writeUrl := fmt.Sprintf("http://localhost:%s/v1/schema/write", tester.readonlyHttpPort)
163+
wresp, err := http.Post(writeUrl, "application/json", strings.NewReader(`{
164+
"schemaText": "definition user {}\ndefinition resource {\nrelation reader: user\nrelation writer: user\nrelation foobar: user\n}"
165+
}`))
166+
require.NoError(err)
167+
require.Equal(503, wresp.StatusCode)
168+
169+
body, err = ioutil.ReadAll(wresp.Body)
170+
require.NoError(err)
171+
require.Contains(string(body), "SERVICE_READ_ONLY")
172+
*/
172173
}
173174

174175
type spicedbHandle struct {

0 commit comments

Comments
 (0)