Skip to content

Commit

Permalink
test: 120m cargo-test loop
Browse files Browse the repository at this point in the history
  • Loading branch information
Manuthor committed Jul 13, 2024
1 parent 5842cfc commit cdc21dd
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 13 deletions.
3 changes: 2 additions & 1 deletion .github/scripts/cargo_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ find . -type d -name cosmian-kms -exec rm -rf \{\} \; -print || true
rm -f /tmp/*.json
export RUST_LOG="cosmian_kms_cli=debug,cosmian_kms_server=debug"
# shellcheck disable=SC2086
cargo test --target $TARGET $RELEASE $FEATURES --workspace -- --nocapture $SKIP_SERVICES_TESTS
# cargo test --target $TARGET $RELEASE $FEATURES --workspace -- --nocapture $SKIP_SERVICES_TESTS
while true; do cargo test --target $TARGET $RELEASE $FEATURES --workspace -- --nocapture $SKIP_SERVICES_TESTS && break; sleep 3; done

rm -rf target/"$TARGET"/debian
rm -rf target/"$TARGET"/generate-rpm
Expand Down
2 changes: 1 addition & 1 deletion crate/cli/src/tests/certificates/validate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ pub fn validate_certificate(
}

#[tokio::test]
#[ignore = "error: connection closed before message completed"]
// #[ignore = "error: connection closed before message completed"]
async fn test_cli_validate() -> Result<(), CliError> {
log_init("cosmian_kms_cli=debug");

Expand Down
10 changes: 5 additions & 5 deletions crate/client/src/kms_rest_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ use cosmian_kmip::kmip::{
ttlv::{deserializer::from_ttlv, serializer::to_ttlv, TTLV},
};
use http::{HeaderMap, HeaderValue, StatusCode};
use log::debug;
use log::trace;
use reqwest::{Client, ClientBuilder, Identity, Response};
use rustls::{client::WebPkiVerifier, Certificate};
use serde::{Deserialize, Serialize};
Expand Down Expand Up @@ -569,7 +569,7 @@ impl KmsClient {
let server_url = format!("{}{endpoint}", self.server_url);
let response = match data {
Some(d) => {
debug!(
trace!(
"==>\n{}",
serde_json::to_string_pretty(&d).unwrap_or("[N/A]".to_string())
);
Expand All @@ -581,7 +581,7 @@ impl KmsClient {
let status_code = response.status();
if status_code.is_success() {
let response = response.json::<R>().await?;
debug!(
trace!(
"<==\n{}",
serde_json::to_string_pretty(&response).unwrap_or("[N/A]".to_string())
);
Expand All @@ -603,7 +603,7 @@ impl KmsClient {
let mut request = self.client.post(&server_url);
let ttlv = to_ttlv(kmip_request)?;

debug!(
trace!(
"==>\n{}",
serde_json::to_string_pretty(&ttlv).unwrap_or("[N/A]".to_string())
);
Expand All @@ -614,7 +614,7 @@ impl KmsClient {
let status_code = response.status();
if status_code.is_success() {
let ttlv = response.json::<TTLV>().await?;
debug!(
trace!(
"<==\n{}",
serde_json::to_string_pretty(&ttlv).unwrap_or("[N/A]".to_string())
);
Expand Down
12 changes: 6 additions & 6 deletions crate/server/src/kms_server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -258,8 +258,8 @@ pub async fn prepare_kms_server(
let mut app = App::new()
.wrap(IdentityMiddleware::default())
.app_data(Data::new(kms_server.clone())) // Set the shared reference to the `KMS` instance.
.app_data(PayloadConfig::new(10_000_000_000)) // Set the maximum size of the request payload.
.app_data(JsonConfig::default().limit(10_000_000_000)); // Set the maximum size of the JSON request payload.
.app_data(PayloadConfig::new(10_000_000)) // Set the maximum size of the request payload.
.app_data(JsonConfig::default().limit(10_000_000)); // Set the maximum size of the JSON request payload.

if enable_google_cse {
// The scope for the Google Client-Side Encryption endpoints served from /google_cse
Expand Down Expand Up @@ -319,10 +319,10 @@ pub async fn prepare_kms_server(

app.service(default_scope)
})
.client_disconnect_timeout(std::time::Duration::from_secs(90))
.tls_handshake_timeout(std::time::Duration::from_secs(90))
.keep_alive(std::time::Duration::from_secs(90))
.client_request_timeout(std::time::Duration::from_secs(90));
.client_disconnect_timeout(std::time::Duration::from_secs(120))
.tls_handshake_timeout(std::time::Duration::from_secs(120))
.keep_alive(std::time::Duration::from_secs(120))
.client_request_timeout(std::time::Duration::from_secs(120));

Ok(match builder {
Some(b) => {
Expand Down

0 comments on commit cdc21dd

Please sign in to comment.