Skip to content

Commit

Permalink
Reuse value
Browse files Browse the repository at this point in the history
  • Loading branch information
XSAM committed Mar 21, 2024
1 parent a82f897 commit ad011d5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions sdk/log/logger_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,14 @@ import (
)

func TestLoggerEmit(t *testing.T) {
nowDate := time.Date(2010, time.January, 1, 0, 0, 0, 0, time.UTC)

nowSwap := now
t.Cleanup(func() {
now = nowSwap
})
now = func() time.Time {
return time.Date(2010, time.January, 1, 0, 0, 0, 0, time.UTC)
return nowDate
}

p0, p1, p2WithError := newProcessor("0"), newProcessor("1"), newProcessor("2")
Expand Down Expand Up @@ -183,7 +185,7 @@ func TestLoggerEmit(t *testing.T) {
body: rWithNoObservedTimestamp.Body(),
severity: rWithNoObservedTimestamp.Severity(),
severityText: rWithNoObservedTimestamp.SeverityText(),
observedTimestamp: time.Date(2010, time.January, 1, 0, 0, 0, 0, time.UTC),
observedTimestamp: nowDate,
resource: resource.NewSchemaless(attribute.String("key", "value")),
attributeValueLengthLimit: 3,
attributeCountLimit: 2,
Expand Down

0 comments on commit ad011d5

Please sign in to comment.