I think the test is incorrect.
Section 10.10 (Conditional Rendering) of the OpenGL 4.4 spec says:
"If the result (SAMPLES_PASSED) of the query is zero, or if the
result (ANY_SAMPLES_PASSED or ANY_SAMPLES_PASSED_CONSERVATIVE)
is false, all rendering commands described in section 2.4 are
discarded and have no effect when issued between
BeginConditionalRender and the corresponding EndConditionalRender."
Section 2.4 (Rendering Commands) says:
"Such commands are called rendering commands, and include the
drawing commands *Draw* (see section 10.5), as well as these
additional commands:
• BlitFramebuffer (see section 18.3.1)
• Clear (see section 17.4.3)
• ClearBuffer* (see section 17.4.3.1)
• DispatchCompute* (see section 19)"
It would have been much better to have these spec references in the commit message and the in-code comments than the reference that is there. Oh well.
Out of curiosity... Does this test pass as-is on NVIDIA or AMD?