Skip to content

Commit

Permalink
fix: remove unnecessary tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nick-bisonai committed Jul 27, 2024
1 parent aa40742 commit 38e0bd4
Showing 1 changed file with 0 additions and 38 deletions.
38 changes: 0 additions & 38 deletions node/pkg/dal/tests/api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -218,42 +218,4 @@ func TestApiWebsocket(t *testing.T) {
t.Fatalf("error closing websocket: %v", err)
}
})

t.Run("test disconnection on no subscription", func(t *testing.T) {
conn, err := wss.NewWebsocketHelper(ctx, wss.WithEndpoint("ws://localhost:8090/ws"), wss.WithRequestHeaders(headers))
if err != nil {
t.Fatalf("error creating websocket helper: %v", err)
}

err = conn.Dial(ctx)
if err != nil {
t.Fatalf("error dialing websocket: %v", err)
}

time.Sleep(6 * time.Second) // Sleep longer than the subscription timeout period
assert.Error(t, conn.IsAlive(ctx), "expected to fail due to no subscription")

err = conn.Close()
if err != nil {
t.Fatalf("error closing websocket: %v", err)
}
})

t.Run("test fail for 10+ dial", func(t *testing.T) {
conn, err := wss.NewWebsocketHelper(ctx, wss.WithEndpoint("ws://localhost:8090/ws"), wss.WithRequestHeaders(headers))
if err != nil {
t.Fatalf("error creating websocket helper: %v", err)
}

for i := 0; i < 10; i++ {
err = conn.Dial(ctx)
if err != nil {
t.Fatalf("error dialing websocket: %v", err)
}
}

err = conn.Dial(ctx)
assert.NoError(t, err)
assert.Error(t, conn.IsAlive(ctx), "expected to fail due to no subscription")
})
}

0 comments on commit 38e0bd4

Please sign in to comment.