I’d like to pose a bit of a philosophical question for the programmers who constitute a significant subset if not an outright majority of my readers. I know what my answer would be, but I don’t want to bias the sample by stating it until I’ve heard a couple of other opinions.

Let’s say that you have a piece of code that usually runs in the kernel. Being a responsible developer, you can also run unit tests on it in user space, and you find a race condition in the unit-test environment. You cannot reproduce the problem in the live environment because the timing and scheduling are completely different. You could add more code to prevent the race but, since you couldn’t reproduce the original problem anyway, you can’t really be sure whether it’s doing any good (or that it’s free of side effects).

The question is: is this a real bug? What additional tests or information would help you decide whether it’s worth fixing or not? If you decide not to fix it, what would you do with the unit test that is failing?