Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion internal/test_cases/blocking_client_group_test_case.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ func (t *BlockingClientGroupTestCase) SendBlockingCommands() error {
}

func (t *BlockingClientGroupTestCase) AssertResponses(logger *logger.Logger) error {
for _, clientWithExpectedResponse := range t.clientsWithExpectedResponses {
for i := len(t.clientsWithExpectedResponses) - 1; i >= 0; i-- {
clientWithExpectedResponse := t.clientsWithExpectedResponses[i]
clientLogger := clientWithExpectedResponse.Client.GetLogger()
if clientWithExpectedResponse.Assertion == nil {
testCase := NoResponseTestCase{}
Expand Down
280 changes: 140 additions & 140 deletions internal/test_helpers/fixtures/geospatial/pass

Large diffs are not rendered by default.

26 changes: 12 additions & 14 deletions internal/test_helpers/fixtures/lists/blpop_wrong_client
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,20 @@ Debug = true
[tester::#EC3] $ ./spawn_redis_server.sh
[your_program] Logs from your program will appear here!
[your_program] Redis server listening on 0.0.0.0:6379
[tester::#EC3] [client-1] Connected (port 63777 -> port 6379)
[tester::#EC3] [client-2] Connected (port 63778 -> port 6379)
[tester::#EC3] [client-3] Connected (port 63779 -> port 6379)
[tester::#EC3] [client-1] Connected (port 59889 -> port 6379)
[tester::#EC3] [client-2] Connected (port 59890 -> port 6379)
[tester::#EC3] [client-3] Connected (port 59891 -> port 6379)
[tester::#EC3] [client-1] $ redis-cli BLPOP pear 0
[tester::#EC3] [client-1] Sent bytes: "*3\r\n$5\r\nBLPOP\r\n$4\r\npear\r\n$1\r\n0\r\n"
[tester::#EC3] [client-2] $ redis-cli BLPOP pear 0
[tester::#EC3] [client-2] Sent bytes: "*3\r\n$5\r\nBLPOP\r\n$4\r\npear\r\n$1\r\n0\r\n"
[tester::#EC3] [client-3] $ redis-cli BLPOP pear 0
[tester::#EC3] [client-3] Sent bytes: "*3\r\n$5\r\nBLPOP\r\n$4\r\npear\r\n$1\r\n0\r\n"
[tester::#EC3] [client-1] $ redis-cli RPUSH pear orange
[tester::#EC3] [client-1] Sent bytes: "*3\r\n$5\r\nRPUSH\r\n$4\r\npear\r\n$6\r\norange\r\n"
[tester::#EC3] [client-1] Received bytes: ":1\r\n"
[tester::#EC3] [client-1] Received RESP integer: 1
[tester::#EC3] [client-1] ✔︎ Received 1
[tester::#EC3] [client-2] Expecting response of BLPOP command
[tester::#EC3] Received: "" (no content received)
[tester::#EC3]  ^ error
[tester::#EC3] Error: Expected start of a new RESP2 value (either +, -, :, $ or *)
[tester::#EC3] [client-3] $ redis-cli RPUSH pear orange
[tester::#EC3] [client-3] Sent bytes: "*3\r\n$5\r\nRPUSH\r\n$4\r\npear\r\n$6\r\norange\r\n"
[tester::#EC3] [client-3] Received bytes: ":1\r\n"
[tester::#EC3] [client-3] Received RESP integer: 1
[tester::#EC3] [client-3] ✔︎ Received 1
[tester::#EC3] [client-2] Expecting no response
[tester::#EC3] client-2 received unexpected response: "*2\r\n$4\r\npear\r\n$6\r\norange\r\n"
[tester::#EC3] Test failed
[tester::#EC3] Terminating program
[tester::#EC3] Program terminated successfully
252 changes: 126 additions & 126 deletions internal/test_helpers/fixtures/lists/pass

Large diffs are not rendered by default.

280 changes: 140 additions & 140 deletions internal/test_helpers/fixtures/pubsub/pass

Large diffs are not rendered by default.

300 changes: 150 additions & 150 deletions internal/test_helpers/fixtures/zset/pass

Large diffs are not rendered by default.

7 changes: 3 additions & 4 deletions internal/test_list_blpop_no_timeout.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,15 @@ func testListBlpopNoTimeout(stageHarness *test_case_harness.TestCaseHarness) err
defer c.Close()
}

sendingClient := clients[0]

listKey := testerutils_random.RandomWord()
pushValue := testerutils_random.RandomWord()

blPopResponseAssertion := resp_assertions.NewOrderedStringArrayAssertion([]string{listKey, pushValue})

blockingClientGroupTestCase := test_cases.BlockingClientGroupTestCase{}
blockingClientGroupTestCase.
AddClientWithExpectedResponse(clients[1], "BLPOP", []string{listKey, "0"}, blPopResponseAssertion).
AddClientWithNoExpectedResponse(clients[2], "BLPOP", []string{listKey, "0"})
AddClientWithExpectedResponse(clients[0], "BLPOP", []string{listKey, "0"}, blPopResponseAssertion).
AddClientWithNoExpectedResponse(clients[1], "BLPOP", []string{listKey, "0"})

// We only send commands here, not expecting responses yet
if err := blockingClientGroupTestCase.SendBlockingCommands(); err != nil {
Expand All @@ -47,6 +45,7 @@ func testListBlpopNoTimeout(stageHarness *test_case_harness.TestCaseHarness) err
Assertion: resp_assertions.NewIntegerAssertion(1),
}

sendingClient := clients[2]
if err := rpushTestCase.Run(sendingClient, logger); err != nil {
return err
}
Expand Down