From a0b506d3756f77aeee040e777bcd98d2d5d7e384 Mon Sep 17 00:00:00 2001 From: mikeee Date: Thu, 18 Apr 2024 13:26:31 +0100 Subject: [PATCH 01/10] chore: remove sleep steps Signed-off-by: mikeee --- examples/actors/client.rs | 4 ---- examples/client/client.rs | 4 ---- examples/configuration/main.rs | 4 ---- examples/crypto/main.rs | 1 - examples/invoke/grpc-proxying/client.rs | 3 --- examples/invoke/grpc/client.rs | 3 --- examples/pubsub/publisher.rs | 4 ---- 7 files changed, 23 deletions(-) diff --git a/examples/actors/client.rs b/examples/actors/client.rs index 11eec37e..5a18dafb 100644 --- a/examples/actors/client.rs +++ b/examples/actors/client.rs @@ -12,10 +12,6 @@ pub struct MyRequest { #[tokio::main] async fn main() -> Result<(), Box> { - // TODO: Handle this issue in the sdk - // Introduce delay so that dapr grpc port is assigned before app tries to connect - std::thread::sleep(std::time::Duration::new(2, 0)); - // Define the Dapr address let addr = "https://127.0.0.1".to_string(); diff --git a/examples/client/client.rs b/examples/client/client.rs index b34d4244..fc048d69 100644 --- a/examples/client/client.rs +++ b/examples/client/client.rs @@ -1,9 +1,5 @@ #[tokio::main] async fn main() -> Result<(), Box> { - // TODO: Handle this issue in the sdk - // Introduce delay so that dapr grpc port is assigned before app tries to connect - std::thread::sleep(std::time::Duration::new(2, 0)); - // Set the Dapr address let addr = "https://127.0.0.1".to_string(); diff --git a/examples/configuration/main.rs b/examples/configuration/main.rs index 0413b5a2..61ce325d 100644 --- a/examples/configuration/main.rs +++ b/examples/configuration/main.rs @@ -5,10 +5,6 @@ type DaprClient = dapr::Client; #[tokio::main] async fn main() -> Result<(), Box> { - // TODO: Handle this issue in the sdk - // Introduce delay so that dapr grpc port is assigned before app tries to connect - std::thread::sleep(std::time::Duration::new(2, 0)); - // Set the Dapr address let addr = "https://127.0.0.1".to_string(); diff --git a/examples/crypto/main.rs b/examples/crypto/main.rs index 0fe42fb3..56001bab 100644 --- a/examples/crypto/main.rs +++ b/examples/crypto/main.rs @@ -7,7 +7,6 @@ use dapr::client::ReaderStream; #[tokio::main] async fn main() -> Result<(), Box> { - sleep(std::time::Duration::new(2, 0)).await; let addr = "https://127.0.0.1".to_string(); let mut client = dapr::Client::::connect(addr).await?; diff --git a/examples/invoke/grpc-proxying/client.rs b/examples/invoke/grpc-proxying/client.rs index 99172962..84d67437 100644 --- a/examples/invoke/grpc-proxying/client.rs +++ b/examples/invoke/grpc-proxying/client.rs @@ -10,9 +10,6 @@ pub mod hello_world { #[tokio::main] async fn main() -> Result<(), Box> { - // Sleep to allow for the server to become available - thread::sleep(Duration::from_secs(5)); - // Get the Dapr port and create a connection let port: u16 = std::env::var("DAPR_GRPC_PORT").unwrap().parse().unwrap(); let address = format!("https://127.0.0.1:{}", port); diff --git a/examples/invoke/grpc/client.rs b/examples/invoke/grpc/client.rs index d3d3cff2..28656d78 100644 --- a/examples/invoke/grpc/client.rs +++ b/examples/invoke/grpc/client.rs @@ -11,9 +11,6 @@ type DaprClient = dapr::Client; #[tokio::main] async fn main() -> Result<(), Box> { - // Sleep to allow for the server to become available - thread::sleep(Duration::from_secs(5)); - // Set the Dapr address let address = "https://127.0.0.1".to_string(); diff --git a/examples/pubsub/publisher.rs b/examples/pubsub/publisher.rs index 543e6b28..4b5600b2 100644 --- a/examples/pubsub/publisher.rs +++ b/examples/pubsub/publisher.rs @@ -17,10 +17,6 @@ struct Refund { #[tokio::main] async fn main() -> Result<(), Box> { - // TODO: Handle this issue in the sdk - // Introduce delay so that dapr grpc port is assigned before app tries to connect - thread::sleep(Duration::from_secs(2)); - // Set address for Dapr connection let addr = "https://127.0.0.1".to_string(); From fd5f6fe606bd77b708704cfb3a237f0eb26fb8e5 Mon Sep 17 00:00:00 2001 From: mikeee Date: Fri, 19 Apr 2024 12:18:21 +0100 Subject: [PATCH 02/10] test: add resiliency validation case Signed-off-by: mikeee --- .github/workflows/validate-examples.yml | 4 +- Cargo.toml | 4 + examples/resiliency/README.md | 98 +++++++++++++++++++++++++ examples/resiliency/main.rs | 31 ++++++++ 4 files changed, 136 insertions(+), 1 deletion(-) create mode 100644 examples/resiliency/README.md create mode 100644 examples/resiliency/main.rs diff --git a/.github/workflows/validate-examples.yml b/.github/workflows/validate-examples.yml index 1e278c6a..49a64669 100644 --- a/.github/workflows/validate-examples.yml +++ b/.github/workflows/validate-examples.yml @@ -144,7 +144,7 @@ jobs: fail-fast: false matrix: examples: - [ "actors", "client", "configuration", "crypto", "invoke/grpc", "invoke/grpc-proxying", "pubsub", "query_state", "secrets-bulk" ] + [ "actors", "client", "configuration", "crypto", "invoke/grpc", "invoke/grpc-proxying", "pubsub", "query_state", "resiliency", "secrets-bulk" ] steps: - name: Check out code uses: actions/checkout@v4 @@ -210,3 +210,5 @@ jobs: run: | cd examples ./validate.sh ${{ matrix.examples }} + + diff --git a/Cargo.toml b/Cargo.toml index adb21d55..07ebc954 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -90,6 +90,10 @@ path = "examples/query_state/query1.rs" name = "query_state_q2" path = "examples/query_state/query2.rs" +[[example]] +name = "resiliency" +path = "examples/resiliency/main.rs" + [[example]] name = "secrets-bulk" path = "examples/secrets-bulk/app.rs" diff --git a/examples/resiliency/README.md b/examples/resiliency/README.md new file mode 100644 index 00000000..645a339f --- /dev/null +++ b/examples/resiliency/README.md @@ -0,0 +1,98 @@ +This example validates the resiliency and does not demonstrate any extra +functionality. It is based off the configuration example to connect to the +sidecar and make a call for a configuration item stored in redis. + +1. Insert a key with the value `hello` to redis using the following command: + + + + +```bash +docker exec dapr_redis redis-cli MSET hello "world" +``` + + + +2. Run the example without the sidecar using the following command: + + + +```bash +cargo run --example resiliency +``` + + + +The result should be that the request will fail. + +3. Run the example without the sidecar (this time in the background) + + + +```bash +cargo run --example resiliency +``` + + + + + +4. Run the Dapr sidecar + + + +```bash +dapr run --app-id=rustapp --resources-path ../components --dapr-grpc-port 3500 +``` + + + +The example app should make contact with the Dapr sidecar and the result should +be returned from the configuration request successfully. + +``` +Configuration value: ConfigurationItem { value: "world", version: "", metadata: {} } +``` diff --git a/examples/resiliency/main.rs b/examples/resiliency/main.rs new file mode 100644 index 00000000..ff54d1c9 --- /dev/null +++ b/examples/resiliency/main.rs @@ -0,0 +1,31 @@ +const CONFIGSTORE_NAME: &str = "configstore"; +type DaprClient = dapr::Client; + +#[tokio::main] +async fn main() -> Result<(), Box> { + // Set the Dapr address + let addr = "https://127.0.0.1".to_string(); + + // Create the client + let mut client = match DaprClient::connect(addr).await { + Ok(client) => { + println!("connected to dapr sidecar"); + client + } + Err(error) => { + panic!("failed to connect to dapr sidecar: {:?}", error) + } + }; + println!("debug"); + + let key = String::from("hello"); + + // get key-value pair in the state store + let response = client + .get_configuration(CONFIGSTORE_NAME, vec![(&key)], None) + .await?; + let val = response.items.get("hello").unwrap(); + println!("Configuration value: {val:?}"); + + Ok(()) +} From d2c7282d0be1da300183a66e785df19976ed7c15 Mon Sep 17 00:00:00 2001 From: mikeee Date: Fri, 19 Apr 2024 12:24:43 +0100 Subject: [PATCH 03/10] chore: cleanup unused imports and removed querystate sleeps Signed-off-by: mikeee --- examples/crypto/main.rs | 1 - examples/invoke/grpc-proxying/client.rs | 2 -- examples/invoke/grpc/client.rs | 2 -- examples/pubsub/publisher.rs | 2 +- examples/query_state/query1.rs | 3 --- examples/query_state/query2.rs | 3 --- 6 files changed, 1 insertion(+), 12 deletions(-) diff --git a/examples/crypto/main.rs b/examples/crypto/main.rs index 56001bab..3c4332cd 100644 --- a/examples/crypto/main.rs +++ b/examples/crypto/main.rs @@ -1,7 +1,6 @@ use std::fs; use tokio::fs::File; -use tokio::time::sleep; use dapr::client::ReaderStream; diff --git a/examples/invoke/grpc-proxying/client.rs b/examples/invoke/grpc-proxying/client.rs index 84d67437..c84f8915 100644 --- a/examples/invoke/grpc-proxying/client.rs +++ b/examples/invoke/grpc-proxying/client.rs @@ -1,5 +1,3 @@ -use std::{thread, time::Duration}; - use hello_world::{greeter_client::GreeterClient, HelloRequest}; use tonic::metadata::MetadataValue; diff --git a/examples/invoke/grpc/client.rs b/examples/invoke/grpc/client.rs index 28656d78..d0d6df70 100644 --- a/examples/invoke/grpc/client.rs +++ b/examples/invoke/grpc/client.rs @@ -1,5 +1,3 @@ -use std::{thread, time::Duration}; - use hello_world::{HelloReply, HelloRequest}; use prost::Message; diff --git a/examples/pubsub/publisher.rs b/examples/pubsub/publisher.rs index 4b5600b2..328c8fd3 100644 --- a/examples/pubsub/publisher.rs +++ b/examples/pubsub/publisher.rs @@ -1,4 +1,4 @@ -use std::{collections::HashMap, thread, time::Duration}; +use std::{collections::HashMap, time::Duration}; use dapr::serde::{Deserialize, Serialize}; use dapr::serde_json; diff --git a/examples/query_state/query1.rs b/examples/query_state/query1.rs index dc6859f8..3fa60fd7 100644 --- a/examples/query_state/query1.rs +++ b/examples/query_state/query1.rs @@ -2,9 +2,6 @@ use serde_json::json; #[tokio::main] async fn main() -> Result<(), Box> { - // Introduce delay so that dapr grpc port is assigned before app tries to connect - std::thread::sleep(std::time::Duration::new(5, 0)); - // Set the Dapr address and create a connection let addr = "https://127.0.0.1".to_string(); diff --git a/examples/query_state/query2.rs b/examples/query_state/query2.rs index e8e0c7cb..15a0a3ad 100644 --- a/examples/query_state/query2.rs +++ b/examples/query_state/query2.rs @@ -2,9 +2,6 @@ use serde_json::json; #[tokio::main] async fn main() -> Result<(), Box> { - // Introduce delay so that dapr grpc port is assigned before app tries to connect - std::thread::sleep(std::time::Duration::new(5, 0)); - // Set the Dapr address and create a connection let addr = "https://127.0.0.1".to_string(); From 3023d28f6d423165491e9816e721d2527b74f720 Mon Sep 17 00:00:00 2001 From: mikeee Date: Fri, 19 Apr 2024 20:25:03 +0100 Subject: [PATCH 04/10] feat(client): implement exponential backoff - resiliency The client now has a configurable exponential backoff policy to aid with resiliency. This can be configured by setting the `DAPR_API_MAX_RETRIES` env var to a value greater than the 0 default. Signed-off-by: mikeee --- Cargo.toml | 1 + src/client.rs | 20 ++++++++++++++++++-- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 07ebc954..2f0827e4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -25,6 +25,7 @@ axum = "0.7.4" tokio = { version = "1.29", features = ["sync"] } tokio-util = { version = "0.7.10", features = ["io"] } chrono = "0.4.24" +backon = "0.4.4" [build-dependencies] tonic-build = "0.11.0" diff --git a/src/client.rs b/src/client.rs index b58d08f9..73f085f0 100644 --- a/src/client.rs +++ b/src/client.rs @@ -1,5 +1,6 @@ +use backon::{ExponentialBuilder, Retryable}; use serde_json::Value; -use std::collections::HashMap; +use std::{collections::HashMap, env, time::Duration}; use async_trait::async_trait; use futures::StreamExt; @@ -544,7 +545,22 @@ pub trait DaprInterface: Sized { #[async_trait] impl DaprInterface for dapr_v1::dapr_client::DaprClient { async fn connect(addr: String) -> Result { - Ok(dapr_v1::dapr_client::DaprClient::connect(addr).await?) + const ENV_DAPR_API_MAX_RETRIES: &str = "DAPR_API_MAX_RETRIES"; + let dapr_api_max_retries = + env::var(ENV_DAPR_API_MAX_RETRIES).unwrap_or_else(|_| "0".to_owned()); + + let retry_policy = ExponentialBuilder::default() + .with_jitter() + .with_min_delay(Duration::from_secs(1)) + .with_max_delay(Duration::from_secs(5)) + .with_max_times(dapr_api_max_retries.parse::().unwrap()); + + let client = (|| dapr_v1::dapr_client::DaprClient::connect(addr.to_owned())) + .retry(&retry_policy) + .await + .expect("client connection"); + + Ok(client) } async fn invoke_service( From e14f34162004c77d3e6db0a7ce397a686ccaf734 Mon Sep 17 00:00:00 2001 From: mikeee Date: Fri, 19 Apr 2024 20:30:13 +0100 Subject: [PATCH 05/10] test(resiliency): tweak validation run and add connection timer Signed-off-by: mikeee --- examples/resiliency/README.md | 10 +++++----- examples/resiliency/main.rs | 6 +++++- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/examples/resiliency/README.md b/examples/resiliency/README.md index 645a339f..619fccd1 100644 --- a/examples/resiliency/README.md +++ b/examples/resiliency/README.md @@ -27,13 +27,13 @@ docker exec dapr_redis redis-cli MSET hello "world" name: Run configuration app (expecting a fail) env: DAPR_GRPC_PORT: "3500" - DAPR_API_MAX_RETRIES: "10" + DAPR_API_MAX_RETRIES: "1" DAPR_API_TIMEOUT_MILLISECONDS: "10000" output_match_mode: substring expected_stdout_lines: - '' expected_stderr_lines: - - 'TransportError' + - 'ConnectError' expected_return_code: 101 background: false sleep: 30 @@ -58,7 +58,7 @@ env: DAPR_API_TIMEOUT_MILLISECONDS: "10000" output_match_mode: substring expected_stdout_lines: - - '== APP == Configuration value: ConfigurationItem { value: "world"' + - 'Configuration value: ConfigurationItem { value: "world"' background: true sleep: 30 timeout_seconds: 30 @@ -80,8 +80,8 @@ output_match_mode: substring expected_stdout_lines: - '' background: true -sleep: 10 -timeout_seconds: 10 +sleep: 15 +timeout_seconds: 15 --> ```bash diff --git a/examples/resiliency/main.rs b/examples/resiliency/main.rs index ff54d1c9..34d335b6 100644 --- a/examples/resiliency/main.rs +++ b/examples/resiliency/main.rs @@ -1,3 +1,5 @@ +use std::time::Instant; + const CONFIGSTORE_NAME: &str = "configstore"; type DaprClient = dapr::Client; @@ -7,6 +9,7 @@ async fn main() -> Result<(), Box> { let addr = "https://127.0.0.1".to_string(); // Create the client + let start_time = Instant::now(); let mut client = match DaprClient::connect(addr).await { Ok(client) => { println!("connected to dapr sidecar"); @@ -16,7 +19,8 @@ async fn main() -> Result<(), Box> { panic!("failed to connect to dapr sidecar: {:?}", error) } }; - println!("debug"); + let client_start_duration = start_time.elapsed(); + println!("Client connection took: {:?}", client_start_duration); let key = String::from("hello"); From 3a42fbcfda3e00450f95da3e8b1a5a4458965613 Mon Sep 17 00:00:00 2001 From: mikeee Date: Sun, 21 Apr 2024 22:14:59 +0100 Subject: [PATCH 06/10] test: implement instance resiliency test case Signed-off-by: mikeee --- .github/workflows/validate-examples.yml | 2 +- Cargo.toml | 8 +- examples/resiliency/instance/README.md | 107 +++++++++++++++++++++ examples/resiliency/instance/main.rs | 47 +++++++++ examples/resiliency/{ => simple}/README.md | 6 +- examples/resiliency/{ => simple}/main.rs | 2 +- 6 files changed, 165 insertions(+), 7 deletions(-) create mode 100644 examples/resiliency/instance/README.md create mode 100644 examples/resiliency/instance/main.rs rename examples/resiliency/{ => simple}/README.md (92%) rename examples/resiliency/{ => simple}/main.rs (93%) diff --git a/.github/workflows/validate-examples.yml b/.github/workflows/validate-examples.yml index 49a64669..9ecbf16b 100644 --- a/.github/workflows/validate-examples.yml +++ b/.github/workflows/validate-examples.yml @@ -144,7 +144,7 @@ jobs: fail-fast: false matrix: examples: - [ "actors", "client", "configuration", "crypto", "invoke/grpc", "invoke/grpc-proxying", "pubsub", "query_state", "resiliency", "secrets-bulk" ] + [ "actors", "client", "configuration", "crypto", "invoke/grpc", "invoke/grpc-proxying", "pubsub", "query_state", "resiliency/instance", "resiliency/simple", "secrets-bulk" ] steps: - name: Check out code uses: actions/checkout@v4 diff --git a/Cargo.toml b/Cargo.toml index 2f0827e4..aa742256 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -92,8 +92,12 @@ name = "query_state_q2" path = "examples/query_state/query2.rs" [[example]] -name = "resiliency" -path = "examples/resiliency/main.rs" +name = "resiliency-instance" +path = "examples/resiliency/instance/main.rs" + +[[example]] +name = "resiliency-simple" +path = "examples/resiliency/simple/main.rs" [[example]] name = "secrets-bulk" diff --git a/examples/resiliency/instance/README.md b/examples/resiliency/instance/README.md new file mode 100644 index 00000000..e38a4ef4 --- /dev/null +++ b/examples/resiliency/instance/README.md @@ -0,0 +1,107 @@ +This example validates the resiliency of the instantiated client and does not +demonstrate any extra functionality. It is based off the configuration example +to connect to the sidecar and make a call for a configuration item stored in +redis. + +1. Insert a key with the value `hello` to redis using the following command: + + + + +```bash +docker exec dapr_redis redis-cli MSET hello "world" +``` + + + +2. Run the example without the sidecar + + + +```bash +cargo run --example resiliency-instance +``` + + + +3. Run the Dapr sidecar + + + +```bash +dapr run --app-id=rustapp --resources-path .../components --dapr-grpc-port 3500 +``` + + + +4. Update the hello key with the value `world2` to redis using the following command: + + + + +```bash +docker exec dapr_redis redis-cli MSET hello "world2" +``` + + + +5. Run the Dapr sidecar (for the second time) + + + +```bash +dapr run --app-id=rustapp --resources-path ../components --dapr-grpc-port 3500 +``` + + +The example app should make contact with the Dapr sidecar and the result should +be returned from the configuration request successfully. + +``` +Configuration value: ConfigurationItem { value: "world", version: "", metadata: {} } +``` diff --git a/examples/resiliency/instance/main.rs b/examples/resiliency/instance/main.rs new file mode 100644 index 00000000..3cdf60b5 --- /dev/null +++ b/examples/resiliency/instance/main.rs @@ -0,0 +1,47 @@ +use std::{ + thread, + time::{Duration, Instant}, +}; + +const CONFIGSTORE_NAME: &str = "configstore"; +type DaprClient = dapr::Client; + +#[tokio::main] +async fn main() -> Result<(), Box> { + // Set the Dapr address + let addr = "https://127.0.0.1".to_string(); + + // Create the client + let start_time = Instant::now(); + let mut client = match DaprClient::connect(addr).await { + Ok(client) => { + println!("connected to dapr sidecar"); + client + } + Err(error) => { + panic!("failed to connect to dapr sidecar: {:?}", error) + } + }; + let client_start_duration = start_time.elapsed(); + println!("Client connection took: {:?}", client_start_duration); + + let key = String::from("hello"); + + // get key-value pair in the state store + let response = client + .get_configuration(CONFIGSTORE_NAME, vec![(&key)], None) + .await?; + let val = response.items.get("hello").unwrap(); + println!("Configuration value: {val:?}"); + + thread::sleep(Duration::from_secs(10)); + println!("app slept for 15 seconds"); + + let response = client + .get_configuration(CONFIGSTORE_NAME, vec![(&key)], None) + .await?; + let val = response.items.get("hello").unwrap(); + println!("Configuration value: {val:?}"); + + Ok(()) +} diff --git a/examples/resiliency/README.md b/examples/resiliency/simple/README.md similarity index 92% rename from examples/resiliency/README.md rename to examples/resiliency/simple/README.md index 619fccd1..ff8e5a78 100644 --- a/examples/resiliency/README.md +++ b/examples/resiliency/simple/README.md @@ -41,7 +41,7 @@ timeout_seconds: 30 --> ```bash -cargo run --example resiliency +cargo run --example resiliency-simple ``` @@ -65,7 +65,7 @@ timeout_seconds: 30 --> ```bash -cargo run --example resiliency +cargo run --example resiliency-simple ``` @@ -85,7 +85,7 @@ timeout_seconds: 15 --> ```bash -dapr run --app-id=rustapp --resources-path ../components --dapr-grpc-port 3500 +dapr run --app-id=rustapp --resources-path .../components --dapr-grpc-port 3500 ``` diff --git a/examples/resiliency/main.rs b/examples/resiliency/simple/main.rs similarity index 93% rename from examples/resiliency/main.rs rename to examples/resiliency/simple/main.rs index 34d335b6..c3e2a2f6 100644 --- a/examples/resiliency/main.rs +++ b/examples/resiliency/simple/main.rs @@ -20,7 +20,7 @@ async fn main() -> Result<(), Box> { } }; let client_start_duration = start_time.elapsed(); - println!("Client connection took: {:?}", client_start_duration); + println!("Client connection took: {client_start_duration:?}"); let key = String::from("hello"); From 2392e35a86f63e34bce9662685efa9291b5b8350 Mon Sep 17 00:00:00 2001 From: mikeee Date: Sun, 7 Jul 2024 23:22:10 +0100 Subject: [PATCH 07/10] chore: fix component paths Signed-off-by: mikeee --- examples/resiliency/instance/README.md | 4 ++-- examples/resiliency/simple/README.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/resiliency/instance/README.md b/examples/resiliency/instance/README.md index e38a4ef4..d3431f7d 100644 --- a/examples/resiliency/instance/README.md +++ b/examples/resiliency/instance/README.md @@ -58,7 +58,7 @@ timeout_seconds: 10 --> ```bash -dapr run --app-id=rustapp --resources-path .../components --dapr-grpc-port 3500 +dapr run --app-id=rustapp --resources-path ../../components --dapr-grpc-port 3500 ``` @@ -95,7 +95,7 @@ timeout_seconds: 10 --> ```bash -dapr run --app-id=rustapp --resources-path ../components --dapr-grpc-port 3500 +dapr run --app-id=rustapp --resources-path ../../components --dapr-grpc-port 3500 ``` diff --git a/examples/resiliency/simple/README.md b/examples/resiliency/simple/README.md index ff8e5a78..b1112786 100644 --- a/examples/resiliency/simple/README.md +++ b/examples/resiliency/simple/README.md @@ -85,7 +85,7 @@ timeout_seconds: 15 --> ```bash -dapr run --app-id=rustapp --resources-path .../components --dapr-grpc-port 3500 +dapr run --app-id=rustapp --resources-path ../../components --dapr-grpc-port 3500 ``` From cb4071638cfea2902c87b52e6b7eda82586f2d8e Mon Sep 17 00:00:00 2001 From: mikeee Date: Sun, 7 Jul 2024 23:36:54 +0100 Subject: [PATCH 08/10] test: update the first resiliency sidecar to not run in the background Signed-off-by: mikeee --- examples/resiliency/instance/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/resiliency/instance/README.md b/examples/resiliency/instance/README.md index d3431f7d..63881454 100644 --- a/examples/resiliency/instance/README.md +++ b/examples/resiliency/instance/README.md @@ -52,7 +52,7 @@ name: Run Dapr sidecar output_match_mode: substring expected_stdout_lines: - '' -background: true +background: false sleep: 10 timeout_seconds: 10 --> From 615db702710d9547215f2fe99aa2d5a57e5238ff Mon Sep 17 00:00:00 2001 From: mikeee Date: Sun, 7 Jul 2024 23:47:14 +0100 Subject: [PATCH 09/10] test: modify resiliency test Signed-off-by: mikeee --- examples/resiliency/instance/README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/resiliency/instance/README.md b/examples/resiliency/instance/README.md index 63881454..6e3829da 100644 --- a/examples/resiliency/instance/README.md +++ b/examples/resiliency/instance/README.md @@ -72,8 +72,8 @@ output_match_mode: substring expected_stdout_lines: - 'OK' background: false -sleep: 5 -timeout_seconds: 5 +sleep: 1 +timeout_seconds: 1 --> ```bash @@ -90,8 +90,8 @@ output_match_mode: substring expected_stdout_lines: - '' background: true -sleep: 10 -timeout_seconds: 10 +sleep: 30 +timeout_seconds: 30 --> ```bash From 3d4c02d938a7ac6262187ff74e966410465eb1b0 Mon Sep 17 00:00:00 2001 From: mikeee Date: Sun, 7 Jul 2024 23:57:55 +0100 Subject: [PATCH 10/10] test: decrease sidecar sleep Signed-off-by: mikeee --- examples/resiliency/instance/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/resiliency/instance/README.md b/examples/resiliency/instance/README.md index 6e3829da..8c945546 100644 --- a/examples/resiliency/instance/README.md +++ b/examples/resiliency/instance/README.md @@ -53,7 +53,7 @@ output_match_mode: substring expected_stdout_lines: - '' background: false -sleep: 10 +sleep: 5 timeout_seconds: 10 -->