hubcio commented on code in PR #2452:
URL: https://github.com/apache/iggy/pull/2452#discussion_r2727819363
##########
core/integration/tests/server/specific.rs:
##########
@@ -130,11 +131,55 @@ async fn tcp_tls_self_signed_scenario_should_be_valid() {
.await
.expect("Failed to connect TLS client with self-signed cert");
- let client =
iggy::clients::client::IggyClient::create(ClientWrapper::Iggy(client), None,
None);
+ let client = IggyClient::create(ClientWrapper::Iggy(client), None, None);
tcp_tls_scenario::run(&client).await;
}
+#[tokio::test]
+#[parallel]
+async fn log_rotation_should_be_valid() {
+ let test_configs = log_rotation_scenario::get_configurations();
+ let mut tasks = Vec::new();
+ for present_log_config in test_configs {
+ let task = tokio::spawn(async move {
+ let mut extra_envs = HashMap::new();
+ extra_envs.insert(
+ "IGGY_SYSTEM_LOGGING_MAX_FILE_SIZE".to_string(),
+ format!("{}", present_log_config.max_single_log_size),
+ );
+ extra_envs.insert(
+ "IGGY_SYSTEM_LOGGING_MAX_TOTAL_SIZE".to_string(),
+ format!("{}", present_log_config.max_total_log_size),
+ );
+ extra_envs.insert(
+ "IGGY_SYSTEM_LOGGING_ROTATION_CHECK_INTERVAL".to_string(),
+ format!("{}", present_log_config.rotation_check_interval),
+ );
+ extra_envs.insert(
+ "IGGY_SYSTEM_LOGGING_RETENTION".to_string(),
+ format!("{}", present_log_config.retention),
+ );
+
+ let mut test_server = TestServer::new(Some(extra_envs), true,
None, IpAddrKind::V4);
+ test_server.start();
+
+ let server_addr = test_server.get_raw_tcp_addr().unwrap();
+ let client_factory = TcpClientFactory {
+ server_addr,
+ ..Default::default()
+ };
+
+ let log_dir = format!("{}/logs",
test_server.get_local_data_path());
+
+ test_server.assert_running();
+ log_rotation_scenario::run(&client_factory, &log_dir,
present_log_config).await;
+ });
+ tasks.push(task);
+ }
+ futures::future::join_all(tasks).await;
Review Comment:
`join_all(tasks).await` returns `Vec<Result<(), JoinError>>` - if one
panics, the test would still pass. change it to something like
```rust
let results = futures::future::join_all(tasks).await;
for result in results {
result.expect("Log rotation test task failed");
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]