package drm import ( "bytes" "strings" "testing" "time" "github.com/bnema/neferwl/internal/ports" "github.com/bnema/zerowrap" "github.com/stretchr/testify/mock" ) // Only the event of our pending commit is traced: a stale event and the // event that ends an EBUSY wait are not. func TestTraceFlipsOnlyOurCommit(t *testing.T) { o, _, commits := testOutput(t) o.cursor = nil o.traceFlips = true var log bytes.Buffer o.log = zerowrap.New(zerowrap.Config{Level: "debug", Format: "json", Output: &log}) seen := map[ports.WindowID]uint64{} flips := func() int { return strings.Count(log.String(), `"message":"flip"`) } if err := o.commitFrame(70, nil, false, false, pendingFrame{}); err != nil { t.Fatal(err) } c := (*commits)[0] stale := flipEvent{crtc: tCrtc, user: c.user + 1<