Skip to content

Commit

Permalink
AVRO-3846: [Rust] Fix race condition among serde tests (#2467)
Browse files Browse the repository at this point in the history
* AVRO-3846: [Rust] Fix race condition among serde tests

* Group related tests
  • Loading branch information
sarutak authored Aug 31, 2023
1 parent b9cbf9a commit 60796e5
Show file tree
Hide file tree
Showing 4 changed files with 205 additions and 1 deletion.
199 changes: 198 additions & 1 deletion lang/rust/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions lang/rust/avro/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,5 @@ criterion = { default-features = false, version = "0.5.1" }
hex-literal = { default-features = false, version = "0.4.1" }
md-5 = { default-features = false, version = "0.10.5" }
pretty_assertions = { default-features = false, version = "1.4.0", features = ["std"] }
serial_test = "2.0.0"
sha2 = { default-features = false, version = "0.10.7" }
3 changes: 3 additions & 0 deletions lang/rust/avro/src/de.rs
Original file line number Diff line number Diff line change
Expand Up @@ -652,6 +652,7 @@ pub fn from_value<'de, D: Deserialize<'de>>(value: &'de Value) -> Result<D, Erro
mod tests {
use pretty_assertions::assert_eq;
use serde::Serialize;
use serial_test::serial;
use std::sync::atomic::Ordering;
use uuid::Uuid;

Expand Down Expand Up @@ -1241,6 +1242,7 @@ mod tests {
}

#[test]
#[serial(avro_3747)]
fn avro_3747_human_readable_false() -> TestResult {
use serde::de::Deserializer as SerdeDeserializer;

Expand All @@ -1255,6 +1257,7 @@ mod tests {
}

#[test]
#[serial(avro_3747)]
fn avro_3747_human_readable_true() -> TestResult {
use serde::de::Deserializer as SerdeDeserializer;

Expand Down
3 changes: 3 additions & 0 deletions lang/rust/avro/src/ser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -492,6 +492,7 @@ mod tests {
use apache_avro_test_helper::TestResult;
use pretty_assertions::assert_eq;
use serde::{Deserialize, Serialize};
use serial_test::serial;
use std::sync::atomic::Ordering;

#[derive(Debug, Deserialize, Serialize, Clone)]
Expand Down Expand Up @@ -1016,6 +1017,7 @@ mod tests {
}

#[test]
#[serial(avro_3747)]
fn avro_3747_human_readable_false() {
use serde::ser::Serializer as SerdeSerializer;

Expand All @@ -1027,6 +1029,7 @@ mod tests {
}

#[test]
#[serial(avro_3747)]
fn avro_3747_human_readable_true() {
use serde::ser::Serializer as SerdeSerializer;

Expand Down

0 comments on commit 60796e5

Please sign in to comment.