Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AzAffinity Read Strategies Test Adjustment #3048

Open
Muhammad-awawdi-amazon opened this issue Feb 3, 2025 · 0 comments
Open

AzAffinity Read Strategies Test Adjustment #3048

Muhammad-awawdi-amazon opened this issue Feb 3, 2025 · 0 comments
Assignees
Labels
bug Something isn't working Rust core redis-rs/glide-core matter testing Everything about testing
Milestone

Comments

@Muhammad-awawdi-amazon
Copy link
Collaborator

Describe the bug

When running test_read_from_replica_az_affinity and test_read_from_replica_az_affinity_replicas_and_primary from test_standalone_client.rs, the tests immediately fall back to ReadFrom::PreferReplica

Expected Behavior

Test should run with the wanted Readstrategy (AZAffinity/AZAffinity_replicas_and_primary) and not fall back to other read strategy

Current Behavior

2025-02-03T15:26:39.142091Z WARN logger_core: types - Failed to convert availability zone string: '""'. Falling back to ReadFrom::PreferReplica``

Reproduction Steps

Run test_read_from_replica_az_affinity and test_read_from_replica_az_affinity_replicas_and_primary from test_standalone_client.rs

Possible Solution

Changing the current struct to handle the availability_zone, as currently it has no reference to az:

struct ReadFromReplicaTestConfig {
        read_from: ReadFrom,
        expected_primary_reads: u16,
        expected_replica_reads: Vec<u16>,
        number_of_initial_replicas: usize,
        number_of_missing_replicas: usize,
        number_of_replicas_dropped_after_connection: usize,
        number_of_requests_sent: usize,
    }

And also create_primary_mock function needs modifications

Additional Information/Context

No response

Client version used

1.2.1

Engine type and version

Not relevant

OS

Not relevant

Language

Rust

Language Version

Not relevant

Cluster information

No response

Logs

  • Executing task: cargo test --package glide-core --test test_standalone_client --all-features -- standalone_client_tests::test_read_from_replica_az_affinity --exact --show-output

    Finished test profile [unoptimized + debuginfo] target(s) in 0.25s
    Running tests/test_standalone_client.rs (target/debug/deps/test_standalone_client-bcd0ef9d759cd597)

running 1 test
2025-02-03T15:26:39.141860Z INFO logger_core: Test - ServerMock started on: localhost:38569
2025-02-03T15:26:39.141895Z INFO logger_core: Test - ServerMock started on: localhost:44859
2025-02-03T15:26:39.141941Z INFO logger_core: Test - ServerMock started on: localhost:35219
2025-02-03T15:26:39.141871Z INFO logger_core: Test - ServerMock started on: localhost:44439
2025-02-03T15:26:39.142091Z WARN logger_core: types - Failed to convert availability zone string: '""'. Falling back to ReadFrom::PreferReplica
2025-02-03T15:26:39.142318Z DEBUG logger_core: connection creation - Attempting connection to Host: localhost, Port: 38569
2025-02-03T15:26:39.142554Z DEBUG logger_core: connection creation - Attempting connection to Host: localhost, Port: 44439
2025-02-03T15:26:39.142690Z DEBUG logger_core: connection creation - Attempting connection to Host: localhost, Port: 44859
2025-02-03T15:26:39.142818Z DEBUG logger_core: connection creation - Attempting connection to Host: localhost, Port: 35219
2025-02-03T15:26:39.142956Z DEBUG redis::aio::connection: Creating TCP connection for node: "localhost:38569", IP: 127.0.0.1
2025-02-03T15:26:39.143161Z DEBUG redis::aio::connection: Creating TCP connection for node: "localhost:44859", IP: 127.0.0.1
2025-02-03T15:26:39.143273Z DEBUG redis::aio::connection: Creating TCP connection for node: "localhost:44439", IP: 127.0.0.1
2025-02-03T15:26:39.143369Z DEBUG redis::aio::connection: Creating TCP connection for node: "localhost:35219", IP: 127.0.0.1
2025-02-03T15:26:39.144005Z INFO logger_core: Test - ThreadId(4) 4\r\n$6\r\nCLIENT\r\n$7\r\nSETINFO\r\n$8\r\nLIB-NAME\r\n$5\r\nGlide\r\n4\r\n$6\r\nCLIENT\r\n$7\r\nSETINFO\r\n$7\r\nLIB-VER\r\n$7\r\nunknown\r\n
2025-02-03T15:26:39.144048Z INFO logger_core: Test - ThreadId(6) 4\r\n$6\r\nCLIENT\r\n$7\r\nSETINFO\r\n$8\r\nLIB-NAME\r\n$5\r\nGlide\r\n4\r\n$6\r\nCLIENT\r\n$7\r\nSETINFO\r\n$7\r\nLIB-VER\r\n$7\r\nunknown\r\n
2025-02-03T15:26:39.144088Z INFO logger_core: Test - ThreadId(5) 4\r\n$6\r\nCLIENT\r\n$7\r\nSETINFO\r\n$8\r\nLIB-NAME\r\n$5\r\nGlide\r\n4\r\n$6\r\nCLIENT\r\n$7\r\nSETINFO\r\n$7\r\nLIB-VER\r\n$7\r\nunknown\r\n
2025-02-03T15:26:39.144110Z INFO logger_core: Test - ThreadId(7) 4\r\n$6\r\nCLIENT\r\n$7\r\nSETINFO\r\n$8\r\nLIB-NAME\r\n$5\r\nGlide\r\n4\r\n$6\r\nCLIENT\r\n$7\r\nSETINFO\r\n$7\r\nLIB-VER\r\n$7\r\nunknown\r\n
2025-02-03T15:26:39.144250Z DEBUG logger_core: connection creation - Connection to localhost:38569 created
2025-02-03T15:26:39.144457Z INFO logger_core: Test - ThreadId(4) *2\r\n$4\r\nINFO\r\n$11\r\nREPLICATION\r\n
2025-02-03T15:26:39.144659Z DEBUG logger_core: connection creation - Connection to localhost:44859 created
2025-02-03T15:26:39.144860Z INFO logger_core: Test - ThreadId(6) *2\r\n$4\r\nINFO\r\n$11\r\nREPLICATION\r\n
2025-02-03T15:26:39.144876Z DEBUG logger_core: connection creation - Connection to localhost:44439 created
2025-02-03T15:26:39.144964Z DEBUG logger_core: connection creation - Connection to localhost:35219 created
2025-02-03T15:26:39.145096Z INFO logger_core: Test - ThreadId(5) *2\r\n$4\r\nINFO\r\n$11\r\nREPLICATION\r\n
2025-02-03T15:26:39.145120Z INFO logger_core: Test - ThreadId(7) *2\r\n$4\r\nINFO\r\n$11\r\nREPLICATION\r\n
2025-02-03T15:26:39.145326Z INFO logger_core: Test - Closing 0 servers after connection established
2025-02-03T15:26:39.145360Z INFO logger_core: Test - sending 3 messages
2025-02-03T15:26:39.247002Z INFO logger_core: Test - ThreadId(6) *2\r\n$3\r\nGET\r\n$3\r\nfoo\r\n
2025-02-03T15:26:39.247424Z INFO logger_core: Test - ThreadId(5) *2\r\n$3\r\nGET\r\n$3\r\nfoo\r\n
2025-02-03T15:26:39.247733Z INFO logger_core: Test - ThreadId(7) *2\r\n$3\r\nGET\r\n$3\r\nfoo\r\n
2025-02-03T15:26:39.248040Z INFO logger_core: Test - ThreadId(7) ServerMock exited
2025-02-03T15:26:39.248139Z INFO logger_core: Test - ThreadId(4) ServerMock exited
2025-02-03T15:26:39.248188Z INFO logger_core: Test - ThreadId(6) ServerMock exited
2025-02-03T15:26:39.248251Z INFO logger_core: Test - ThreadId(5) ServerMock exited
test standalone_client_tests::test_read_from_replica_az_affinity ... ok

successes:

successes:
standalone_client_tests::test_read_from_replica_az_affinity

test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 15 filtered out; finished in 0.11s

  • Terminal will be reused by tasks, press any key to close it.

Other information

No response

@Muhammad-awawdi-amazon Muhammad-awawdi-amazon added bug Something isn't working Rust core redis-rs/glide-core matter testing Everything about testing labels Feb 3, 2025
@Muhammad-awawdi-amazon Muhammad-awawdi-amazon added this to the 1.4 milestone Feb 3, 2025
@Muhammad-awawdi-amazon Muhammad-awawdi-amazon self-assigned this Feb 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Rust core redis-rs/glide-core matter testing Everything about testing
Projects
None yet
Development

No branches or pull requests

1 participant