Skip to content

Commit e14f341

Browse files
committed
test(resiliency): tweak validation run and add connection timer
Signed-off-by: mikeee <[email protected]>
1 parent 3023d28 commit e14f341

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

examples/resiliency/README.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,13 @@ docker exec dapr_redis redis-cli MSET hello "world"
2727
name: Run configuration app (expecting a fail)
2828
env:
2929
DAPR_GRPC_PORT: "3500"
30-
DAPR_API_MAX_RETRIES: "10"
30+
DAPR_API_MAX_RETRIES: "1"
3131
DAPR_API_TIMEOUT_MILLISECONDS: "10000"
3232
output_match_mode: substring
3333
expected_stdout_lines:
3434
- ''
3535
expected_stderr_lines:
36-
- 'TransportError'
36+
- 'ConnectError'
3737
expected_return_code: 101
3838
background: false
3939
sleep: 30
@@ -58,7 +58,7 @@ env:
5858
DAPR_API_TIMEOUT_MILLISECONDS: "10000"
5959
output_match_mode: substring
6060
expected_stdout_lines:
61-
- '== APP == Configuration value: ConfigurationItem { value: "world"'
61+
- 'Configuration value: ConfigurationItem { value: "world"'
6262
background: true
6363
sleep: 30
6464
timeout_seconds: 30
@@ -80,8 +80,8 @@ output_match_mode: substring
8080
expected_stdout_lines:
8181
- ''
8282
background: true
83-
sleep: 10
84-
timeout_seconds: 10
83+
sleep: 15
84+
timeout_seconds: 15
8585
-->
8686

8787
```bash

examples/resiliency/main.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
use std::time::Instant;
2+
13
const CONFIGSTORE_NAME: &str = "configstore";
24
type DaprClient = dapr::Client<dapr::client::TonicClient>;
35

@@ -7,6 +9,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
79
let addr = "https://127.0.0.1".to_string();
810

911
// Create the client
12+
let start_time = Instant::now();
1013
let mut client = match DaprClient::connect(addr).await {
1114
Ok(client) => {
1215
println!("connected to dapr sidecar");
@@ -16,7 +19,8 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
1619
panic!("failed to connect to dapr sidecar: {:?}", error)
1720
}
1821
};
19-
println!("debug");
22+
let client_start_duration = start_time.elapsed();
23+
println!("Client connection took: {:?}", client_start_duration);
2024

2125
let key = String::from("hello");
2226

0 commit comments

Comments
 (0)