> > 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(...));
> > 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; THAT(out. str(), HasSubstring(...));
out << bundle;
ASSERT_
Have a timer thread that breaks the lock.