Skip to content

Commit

Permalink
Try setting HTTP_PROXY
Browse files Browse the repository at this point in the history
  • Loading branch information
kegsay committed Dec 1, 2023
1 parent 6b85d78 commit 4a3d9fc
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tests/client_connectivity_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package tests
import (
"fmt"
"net/http"
"os"
"os/exec"
"testing"
"time"
Expand Down Expand Up @@ -37,13 +38,17 @@ func TestClientRetriesSendToDevice(t *testing.T) {

var evID string
var err error
os.Setenv("HTTP_PROXY", tc.Deployment.ControllerURL) // TODO FIXME
// now gateway timeout the /sendToDevice endpoint
tc.Deployment.WithMITMOptions(t, map[string]interface{}{
"statuscode": map[string]interface{}{
"return_status": http.StatusGatewayTimeout,
"filter": "~u .*\\/sendToDevice.*",
},
}, func() {
t.Logf("LOCKED")
return

evID, err = alice.TrySendMessage(t, roomID, wantMsgBody)
if err != nil {
// we allow clients to fail the send if they cannot call /sendToDevice
Expand All @@ -53,6 +58,8 @@ func TestClientRetriesSendToDevice(t *testing.T) {
t.Logf("TrySendMessage: => %s", evID)
}
})
os.Unsetenv("HTTP_PROXY")
return

if err != nil {
// retry now we have connectivity
Expand Down

0 comments on commit 4a3d9fc

Please sign in to comment.