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

serial doesn't seem to serialize should_panic tests correctly. #12

Closed
Monnoroch opened this issue Dec 7, 2019 · 7 comments · Fixed by #13
Closed

serial doesn't seem to serialize should_panic tests correctly. #12

Monnoroch opened this issue Dec 7, 2019 · 7 comments · Fixed by #13
Assignees

Comments

@Monnoroch
Copy link

I assume it has a similar cause to #10.

@palfrey palfrey self-assigned this Dec 7, 2019
@Monnoroch
Copy link
Author

Thanks for a swift fix!

@Monnoroch
Copy link
Author

Hi, I don't think the fix has worked. I still see a value being accessed from multiple threads when I put a test with #[should_panic(expected = "upsupported version")] in the test module.

@palfrey
Copy link
Owner

palfrey commented Dec 9, 2019

Do you have a link to some example code that's not working?

@Monnoroch
Copy link
Author

Sure thing. Here's the commit. It also has a travis CI link with the failures.

Here's the message:

failures:
---- vm::java_vm_attach_tests::attach_unsupported_version stdout ----
thread 'vm::java_vm_attach_tests::attach_unsupported_version' panicked at 'trying to access wrapped value in fragile container from incorrect thread.', /home/travis/.cargo/registry/src/github.com-1ecc6299db9ec823/fragile-0.3.0/src/fragile.rs:57:13
note: panic did not include expected string 'upsupported version'
---- vm::java_vm_with_attached_tests::with_attached_unsupported_version stdout ----
thread 'vm::java_vm_with_attached_tests::with_attached_unsupported_version' panicked at 'trying to access wrapped value in fragile container from incorrect thread.', /home/travis/.cargo/registry/src/github.com-1ecc6299db9ec823/fragile-0.3.0/src/fragile.rs:57:13
note: panic did not include expected string 'upsupported version'

The error message is the same locally. When I move these two failed tests (both should_panic) into their own test modules, tests pass. Judging by the error message, I assume the issue is in serial tests not being truly serial, since the global variables are accessed from multiple threads.

@palfrey
Copy link
Owner

palfrey commented Dec 9, 2019

I've managed to at least reproduce part of the problem, in that should_panic didn't work if you handed it attributes. #15 should fix this which will get merged shortly.

@Monnoroch
Copy link
Author

Just tested the commit and it is indeed fixed. Thank you so much! Amazing bugfixing speed :)

@palfrey
Copy link
Owner

palfrey commented Dec 9, 2019

Not a problem :) I'll probably put out a new release in a few days or so, once this one's had time for anyone else to bring up more bugs...

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

Successfully merging a pull request may close this issue.

2 participants