Skip to content

Commit

Permalink
Added new image
Browse files Browse the repository at this point in the history
Signed-off-by: Jonsy13 <[email protected]>
  • Loading branch information
Jonsy13 committed Jan 2, 2024
1 parent 05bcd28 commit a214e85
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions toxics/toxic_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package toxics_test
import (
"bufio"
"bytes"
"context"
"encoding/json"
"io"
"net"
Expand Down Expand Up @@ -140,8 +139,6 @@ func AssertEchoResponse(t *testing.T, client, server net.Conn) {
}

func TestPersistentConnections(t *testing.T) {
ctx := context.Background()

ln, err := net.Listen("tcp", "localhost:0")
if err != nil {
t.Fatal("Failed to create TCP server", err)
Expand Down Expand Up @@ -177,11 +174,11 @@ func TestPersistentConnections(t *testing.T) {

AssertEchoResponse(t, conn, serverConn)

proxy.Toxics.ResetToxics(ctx)
proxy.Toxics.ResetToxics()

AssertEchoResponse(t, conn, serverConn)

proxy.Toxics.ResetToxics(ctx)
proxy.Toxics.ResetToxics()

AssertEchoResponse(t, conn, serverConn)

Expand Down Expand Up @@ -232,9 +229,9 @@ func TestToxicAddRemove(t *testing.T) {
proxy.Toxics.AddToxicJson(
ToxicToJson(t, "noop_up", "noop", "upstream", &toxics.NoopToxic{}),
)
proxy.Toxics.RemoveToxic(context.Background(), "noop_down")
proxy.Toxics.RemoveToxic("noop_down")
} else {
proxy.Toxics.RemoveToxic(context.Background(), "noop_up")
proxy.Toxics.RemoveToxic("noop_up")
proxy.Toxics.AddToxicJson(
ToxicToJson(t, "noop_down", "noop", "downstream", &toxics.NoopToxic{}),
)
Expand Down

0 comments on commit a214e85

Please sign in to comment.