MCPcopy
hub / github.com/docker/compose / assertEvents

Method assertEvents

pkg/watch/notify_test.go:540–558  ·  view source on GitHub ↗
(expected ...string)

Source from the content-addressed store, hash-verified

538}
539
540func (f *notifyFixture) assertEvents(expected ...string) {
541 f.fsync()
542 if runtime.GOOS == "windows" {
543 // NOTE(nick): It's unclear to me why an extra fsync() helps
544 // here, but it makes the I/O way more predictable.
545 f.fsync()
546 }
547
548 if len(f.events) != len(expected) {
549 f.T().Fatalf("Got %d events (expected %d): %v %v", len(f.events), len(expected), f.events, expected)
550 }
551
552 for i, actual := range f.events {
553 e := FileEvent(expected[i])
554 if actual != e {
555 f.T().Fatalf("Got event %v (expected %v)", actual, e)
556 }
557 }
558}
559
560func (f *notifyFixture) consumeEventsInBackground(ctx context.Context) chan error {
561 done := make(chan error)

Callers 15

TestNoEventsFunction · 0.80
TestNoWatchesFunction · 0.80
TestEventOrderingFunction · 0.80
TestGitBranchSwitchFunction · 0.80
TestWatchesAreRecursiveFunction · 0.80
TestWatchNonExistentPathFunction · 0.80
TestRemoveFunction · 0.80
TestRemoveAndAddBackFunction · 0.80
TestSingleFileFunction · 0.80
TestWriteBrokenLinkFunction · 0.80

Calls 3

fsyncMethod · 0.95
FileEventTypeAlias · 0.85
TMethod · 0.80

Tested by

no test coverage detected