[rfc][icedtea-web][policyeditor] Unit tests fix after last PolicyEditor async IO patch

Jie Kang jkang at redhat.com
Tue Jun 3 21:12:11 UTC 2014


Hello,

I tested the patch and everything works as expected. 0.5 from me.

Regards,

----- Original Message -----
> Hi,
> 
> There's a race between the unit tests and PolicyEditor instances that is
> causing several PolicyEditor tests to sporadically fail, due to the
> tests asserting certain conditions about the contents of the policy file
> model before it has actually been opened and parsed. This patch fixes
> the race by adding a "performingIO" field to the editor, which is simply
> marked true immediately before starting an IO operation and marked false
> immediately after completing it. The test cases then poll the editor
> every 50ms, waiting for it to complete its IO, before performing the
> actual tests.
> 
> Additionally, the new progress bar dialog which appears during blocking
> IO does so assuming that the editor panel is contained within some
> window, which it uses as its parent to set its modality and to center
> itself. However, this is not necessarily the case - PolicyEditor can
> actually be used headless, and is used headless during the unit tests.
> The dialog appears during the unit tests regardless of the fact that
> there is no parent window. This is solved by simply checking if the
> parent window of the editor panel is null, and if it is, not invoking
> the Runnable which displays the progress indicator.
> 
> Thanks,
> 
> --
> Andrew A
> 
> 


More information about the distro-pkg-dev mailing list