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

A possible FAQ question #655

Open
davecb opened this issue Jan 21, 2022 · 0 comments
Open

A possible FAQ question #655

davecb opened this issue Jan 21, 2022 · 0 comments

Comments

@davecb
Copy link

davecb commented Jan 21, 2022

I have a program that communicated between threads via a channel.
To test an error condition in the receiver, I wrote

Convey("Passing bad operations to send should panic worker", func(c C) {
	// the panic happens in worker(), not send,
	c.So(func() { r.send(-1, Err, 1) }, ShouldPanic)
})

r.send sends an illegal -1, the worker thread duly panics, and send returns without error, rather than reporting that a different thread panicked.

How do I construct a test that detects a panic in another thread? Can I?

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

No branches or pull requests

1 participant