Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Fix #5495. Combine two tests to prevent race cond #5656
Conversation
mdboom
added the
needs_review
label
Dec 10, 2015
mdboom
added this to the
Critical bugfix release (1.5.1)
milestone
Dec 10, 2015
|
The nice thing is is that if my theory is correct, this is a test-only bug, and not really a bug in matplotlib itself. Longer term, we could add some sort of hook to the testing infrastructure so that filenames can't be reused or so that writes are atomic. |
|
I think your hypothesis is correct for the theoretical race condition, but I don't see how this is any better. Wouldn't the results get saved out to the same named file? So if the first figure had a regression in it, the second figure could clobber that. |
|
Yes, the results get saved out to the same file, but they are compared one-at-a-time. So both are tested against the same baseline image in turn. It does mean that the first one to fail is the one that's left on disk for inspection later, and there may be other failures "beyond" that, but that's no worse than the usual situation with asserts in unit tests. We have a number of tests that do this already without problem. |
|
ah, ok. That makes sense. Just waiting for Travis to greenlight this. |
jenshnielsen
added a commit
that referenced
this pull request
Dec 11, 2015
|
|
jenshnielsen |
bdb8450
|
jenshnielsen
merged commit bdb8450
into matplotlib:master
Dec 11, 2015
tacaswell
removed the
needs_review
label
Dec 11, 2015
jenshnielsen
added a commit
that referenced
this pull request
Dec 11, 2015
|
|
jenshnielsen + jenshnielsen |
dfadd4d
|
|
back ported as dfadd4d |
mdboom commentedDec 10, 2015
There are two tests in
test_cycles.pythat use the same baseline image. If running the tests in multiprocess mode, it's theoretically possible that both tests would write to the output file at the same time, corrupting the file and hence the backtrace when reading it back in. I think combining these into a single test with the same image file will accomplish what is intended (sharing the same baseline data) but never run in parallel.