Mir

Code review comment for lp:~dandrader/mir/switchingBundle_lp1270964

Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

> > I'm not a fan of tests that fail by hanging.
>
> Me neither, suggestions?
>
> That's the external, "visible", symptom of this bug. The other option being
> checking the internal state of SwitchingBundle after each step to see if doing
> things correctly. But duflu doesn't like that.
>
> I vote for internal state checks, as explained on a previous comment.
>
> So, what do we do?
> 1 - test if it locks (current approach)
> 2 - check the internal state (doesn't hang when it fails as it detects the
> issue at earlier steps)
> 3 - Suggestions?

Some (not necessarily good) suggestions...

Expose enough of the state to enable a check through the public interface. e.g.

   ASSERT_TRUE(bundle.is_valid());

Or check the result of streaming?

    std::ostringstream out;
    out << bundle;
    ASSERT_THAT(out.str(), HasSubstring(...));

Have a timer thread that breaks the lock.

« Back to merge proposal