This is an automated email from the ASF dual-hosted git repository. mgrigorov pushed a commit to branch issue-53-debug-failing-test in repository https://gitbox.apache.org/repos/asf/avro-rs.git
commit b509fa1d2609501511c068413548be1400d1325d Author: Martin Tzvetanov Grigorov <[email protected]> AuthorDate: Wed Dec 4 10:13:34 2024 +0200 Issue #71 - Use `serial_test` for the test from issue #53 The test depends on Serde's is_human_readable() state Signed-off-by: Martin Tzvetanov Grigorov <[email protected]> --- avro/src/de.rs | 4 ++-- avro/src/schema.rs | 7 +++++++ avro/src/ser.rs | 4 ++-- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/avro/src/de.rs b/avro/src/de.rs index cc590ea..7df963a 100644 --- a/avro/src/de.rs +++ b/avro/src/de.rs @@ -1449,7 +1449,7 @@ mod tests { } #[test] - #[serial(avro_3747)] + #[serial(serde_is_human_readable)] fn avro_3747_human_readable_false() -> TestResult { use serde::de::Deserializer as SerdeDeserializer; @@ -1464,7 +1464,7 @@ mod tests { } #[test] - #[serial(avro_3747)] + #[serial(serde_is_human_readable)] fn avro_3747_human_readable_true() -> TestResult { use serde::de::Deserializer as SerdeDeserializer; diff --git a/avro/src/schema.rs b/avro/src/schema.rs index 343af0a..b89f07b 100644 --- a/avro/src/schema.rs +++ b/avro/src/schema.rs @@ -2508,6 +2508,7 @@ pub mod derive { #[cfg(test)] mod tests { + use std::sync::atomic::Ordering; use super::*; use crate::{rabin::Rabin, SpecificSingleObjectWriter}; use apache_avro_test_helper::{ @@ -2515,6 +2516,7 @@ mod tests { TestResult, }; use serde_json::json; + use serial_test::serial; #[test] fn test_invalid_schema() { @@ -6444,6 +6446,7 @@ mod tests { } #[test] + #[serial(serde_is_human_readable)] fn avro_rs_53_uuid_with_fixed() -> TestResult { #[derive(Debug, Serialize, Deserialize)] struct Comment { @@ -6475,6 +6478,10 @@ mod tests { id: "de2df598-9948-4988-b00a-a41c0e287398".parse()?, }; let mut buffer = Vec::new(); + + let is_human_readable = true; + crate::util::SERDE_HUMAN_READABLE.store(is_human_readable, Ordering::Release); + SpecificSingleObjectWriter::<Comment>::with_capacity(10)? .write_ref(&payload, &mut buffer)?; diff --git a/avro/src/ser.rs b/avro/src/ser.rs index d497568..2d636fe 100644 --- a/avro/src/ser.rs +++ b/avro/src/ser.rs @@ -1021,7 +1021,7 @@ mod tests { } #[test] - #[serial(avro_3747)] + #[serial(serde_is_human_readable)] fn avro_3747_human_readable_false() { use serde::ser::Serializer as SerdeSerializer; @@ -1033,7 +1033,7 @@ mod tests { } #[test] - #[serial(avro_3747)] + #[serial(serde_is_human_readable)] fn avro_3747_human_readable_true() { use serde::ser::Serializer as SerdeSerializer;
