From 11b4fd7040348fd335856517a92f073737120ddf Mon Sep 17 00:00:00 2001 From: Adrian Bogatu Date: Fri, 6 Oct 2017 17:26:29 +0300 Subject: [PATCH] Add test case for FollowsFrom clockskew fix Signed-off-by: Adrian Bogatu --- model/adjuster/clockskew_test.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/model/adjuster/clockskew_test.go b/model/adjuster/clockskew_test.go index 6e4ba678cfa..868f3299be4 100644 --- a/model/adjuster/clockskew_test.go +++ b/model/adjuster/clockskew_test.go @@ -33,6 +33,7 @@ func TestClockSkewAdjuster(t *testing.T) { host string adjusted int // start time after adjustment adjustedLogs []int // adjusted log timestamps + refs []model.SpanRef } toTime := func(t int) time.Time { @@ -112,6 +113,13 @@ func TestClockSkewAdjuster(t *testing.T) { {id: 2, parent: 1, startTime: 0, duration: 50, host: "a", adjusted: 0}, }, }, + { + description: "do not adjust child that follows from parent", + trace: []spanProto{ + {id: 1, parent: 0, startTime: 10, duration: 100, host: "a", adjusted: 10}, + {id: 2, parent: 1, startTime: 110, duration: 100, host: "a", adjusted: 110, refs: []model.SpanRef{model.SpanRef{RefType: model.FollowsFrom, SpanID: 1}}}, + }, + }, { description: "do not adjust child that fits inside parent", trace: []spanProto{