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

Port Golang chan1.go Test #615

Merged
merged 4 commits into from
Dec 31, 2020

Conversation

SkamDart
Copy link
Contributor

@SkamDart SkamDart commented Dec 21, 2020

Rust port chan1.go

Based on an ask in #201

panic!("fail")
}
data[r] = 2;
drop(data);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Someone who is more experienced with Rust than I am probably knows why, but this blocks unless I manually drop.
Any thoughts?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There may be an odd interaction with select macro. I'll take a look.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@taiki-e What do I need to do to get this PR merged in?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even if I remove drop(data) in the r function, I couldn't reproduce block. I can reproduce block by removing the drop(data) in the s function, but it will not block if I disable parallel tests (cargo test -- --test-threads=1) or run the test individually (cargo test --test golang -- chan1::main).

@SkamDart Could you remove drop(data) in the r function and leave the link to this comment on the drop(data) in the s function as a comment? (Otherwise, LGTM)

Copy link
Member

@taiki-e taiki-e left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! LGTM aside from a nit. I'll merge when a suggested change is applied.

crossbeam-channel/tests/golang.rs Outdated Show resolved Hide resolved
Copy link
Member

@taiki-e taiki-e left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bors r+

@bors
Copy link
Contributor

bors bot commented Dec 31, 2020

Build succeeded!

And happy new year! 🎉

@bors bors bot merged commit 6c3409d into crossbeam-rs:master Dec 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

2 participants