potential bug: Race condition in include code
It seems there's a race condition somewhere in the Reader.include() code.
I was exploring the behaviour of the includes.*.dir options and I wrote some tests. When I did this, I found there two different behaviours that it would switch between intermittently. I tried to capture what I think is the expected behaviour in the tests and when you run the tests they will pass about 50% of the time.
I found that if I force the "include loop" to not have any concurrency, the tests pass 100% of the time.
I have tried to play around with the variable assignments and mutations that happen inside include, to see if I can isolate the cause, but no luck yet. In this PR I am posting only the tests and the concurrency fix (commented out), to highlight the problem and see if anyone has any ideas as to what's causing it.
I will continue to explore it - but if anyone has any ideas, let me know.