Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AVRO-3846: [Rust] Fix race condition among serde tests #2467

Merged
merged 2 commits into from
Aug 31, 2023

Conversation

sarutak
Copy link
Member

@sarutak sarutak commented Aug 26, 2023

AVRO-3846

What is the purpose of the change

This PR fixes an issue that race condition happens among serde tests named avro_3747*.

Sometimes one of tests named avro_3747* fails.
You can easily reproduce this issue frequently with cargo test like as follows.

$ cargo test avro_3747

The reason is that these tests run concurrently and save/load the same atomic variable.
So this PR introduces serial_test crate and make these tests run in serial.

Verifying this change

Confirmed tests named avro_3747* don't fail.

Documentation

  • Does this pull request introduce a new feature? (no)

@github-actions github-actions bot added the Rust label Aug 26, 2023
@martin-g
Copy link
Member

Thanks, @sarutak !
I haven't faced this problem until now but knowing how it works I understand that it is a real issue!

How about using serial_file(key, "some/path") instead ? By using _file we can group such related tests. Later if we need to have more serial tests we won't need to lock on unrelated problems.

@sarutak
Copy link
Member Author

sarutak commented Aug 31, 2023

Thank you for the comment @martin-g !
I agree that it's better to group related tests.
How about using serial attribute like serial(avro_3747) for such purpose rather than file_serial?
https://docs.rs/serial_test/latest/serial_test/attr.serial.html

@martin-g martin-g merged commit 60796e5 into apache:master Aug 31, 2023
15 checks passed
martin-g pushed a commit that referenced this pull request Aug 31, 2023
* AVRO-3846: [Rust] Fix race condition among serde tests

* Group related tests

(cherry picked from commit 60796e5)
@martin-g
Copy link
Member

Thank you, @sarutak !

RanbirK pushed a commit to RanbirK/avro that referenced this pull request May 13, 2024
* AVRO-3846: [Rust] Fix race condition among serde tests

* Group related tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants