Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AssertCanStopWhenSending ¶
func AssertCanStopWhenSending(c *C, stopper Stopper)
AssertCanStopWhenSending ensures even when there are changes pending to be delivered by the watcher it can still stop cleanly. This is necessary to check for deadlocks in case the watcher's inner loop is blocked trying to send and its tomb is already dying.
func AssertStop ¶
func AssertStop(c *C, stopper Stopper)
Types ¶
type NotifyWatcher ¶
type NotifyWatcher interface {
Changes() <-chan struct{}
}
type NotifyWatcherC ¶
type NotifyWatcherC struct { *C State *state.State Watcher NotifyWatcher }
NotifyWatcherC embeds a gocheck.C and adds methods to help verify the behaviour of any watcher that uses a <-chan struct{}.
func NewNotifyWatcherC ¶
func NewNotifyWatcherC(c *C, st *state.State, w NotifyWatcher) NotifyWatcherC
NewNotifyWatcherC returns a NotifyWatcherC that checks for aggressive event coalescence.
func (NotifyWatcherC) AssertClosed ¶
func (c NotifyWatcherC) AssertClosed()
func (NotifyWatcherC) AssertNoChange ¶
func (c NotifyWatcherC) AssertNoChange()
func (NotifyWatcherC) AssertOneChange ¶
func (c NotifyWatcherC) AssertOneChange()
type StringsWatcher ¶
type StringsWatcherC ¶
type StringsWatcherC struct { *C State *state.State Watcher StringsWatcher }
StringsWatcherC embeds a gocheck.C and adds methods to help verify the behaviour of any watcher that uses a <-chan []string.
func NewStringsWatcherC ¶
func NewStringsWatcherC(c *C, st *state.State, w StringsWatcher) StringsWatcherC
NewStringsWatcherC returns a StringsWatcherC that checks for aggressive event coalescence.
func (StringsWatcherC) AssertChange ¶
func (c StringsWatcherC) AssertChange(expect ...string)
AssertChange asserts the given list of changes was reported by the watcher, but does not assume there are no following changes.
func (StringsWatcherC) AssertClosed ¶
func (c StringsWatcherC) AssertClosed()
func (StringsWatcherC) AssertNoChange ¶
func (c StringsWatcherC) AssertNoChange()