Closed luke-titley closed 5 years ago
// check that the number of entries is the same
assert_eq!(super::num_entries(), hs.len());
Did you run it with
RUST_TEST_THREADS=1 cargo test
?
On Sat, 9 Nov 2019 at 11:35, luke-titley notifications@github.com wrote:
// check that the number of entries is the same assert_eq!(super::num_entries(), hs.len());
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/anderslanglands/ustr/issues/4?email_source=notifications&email_token=AAOYQXPBL5OSWU4WY6SLQYDQSXSURA5CNFSM4JK7ZGSKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEDTR3CY#issuecomment-552017291, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAOYQXM6T6W6K7MX2HKJYGTQSXSURANCNFSM4JK7ZGSA .
Everything passes when it's all on one thread.
Great!
On Sun, 10 Nov 2019 at 04:33, luke-titley notifications@github.com wrote:
Everything passes when it's all on one thread.
— You are receiving this because you commented.
Reply to this email directly, view it on GitHub https://github.com/anderslanglands/ustr/issues/4?email_source=notifications&email_token=AAOYQXPI3ENGP25O5ZLKTG3QS3J5ZA5CNFSM4JK7ZGSKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEDUIUXQ#issuecomment-552110686, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAOYQXPNOETYLBX4DAT2LWLQS3J5ZANCNFSM4JK7ZGSA .
Is it intended to be thread safe ?
Yes, and it is.
What's happening is that some of the tests put, say, 5 strings in the cache, then check that there actually are 5 strings in the cache. This is fine when you run the tests on a single thread, but if multiple tests are running concurrently, then when the check happens there could be any number of strings in the cache because other tests are adding strings at the same time. This is to be expected and is still thread-safe, it's just not great for unit testing.
On Mon, 11 Nov 2019 at 10:58, luke-titley notifications@github.com wrote:
Is it intended to be thread safe ?
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/anderslanglands/ustr/issues/4?email_source=notifications&email_token=AAOYQXOBJFRZHOOSNMYKZR3QTB7W5A5CNFSM4JK7ZGSKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEDVIASI#issuecomment-552239177, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAOYQXOVFHMJ6LZ6X54U3PLQTB7W5ANCNFSM4JK7ZGSA .
Aaah, right. Great!
Ah, I'm a fool. You already wrote this in the README.md
No worries :)
Hey, I'm getting a unit test failure in tests::blns. I'm on a mac (mojave 10.14.10).
This is on the master and serde branches.
Release and debug builds.