Skip to content

Commit

Permalink
elastic#28472 fix flaky tests in libbeat fmtstr to use time.UTC inste…
Browse files Browse the repository at this point in the history
…ad of time.Local
  • Loading branch information
Alan Hinchliff committed Oct 15, 2021
1 parent b3991d4 commit de0a916
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions libbeat/common/fmtstr/formatevents_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ func TestEventFormatString(t *testing.T) {
"test timestamp formatter",
"%{[key]}: %{+YYYY.MM.dd}",
beat.Event{
Timestamp: time.Date(2015, 5, 1, 20, 12, 34, 0, time.Local),
Timestamp: time.Date(2015, 5, 1, 20, 12, 34, 0, time.UTC),
Fields: common.MapStr{
"key": "timestamp",
},
Expand All @@ -121,7 +121,7 @@ func TestEventFormatString(t *testing.T) {
"test timestamp formatter",
"%{[@timestamp]}: %{+YYYY.MM.dd}",
beat.Event{
Timestamp: time.Date(2015, 5, 1, 20, 12, 34, 0, time.Local),
Timestamp: time.Date(2015, 5, 1, 20, 12, 34, 0, time.UTC),
Fields: common.MapStr{
"key": "timestamp",
},
Expand Down
4 changes: 2 additions & 2 deletions libbeat/common/fmtstr/formattimestamp_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,14 @@ func TestTimestampFormatString(t *testing.T) {
"test timestamp formatter",
"%{[key]}: %{+YYYY.MM.dd}",
common.MapStr{"key": "timestamp"},
time.Date(2015, 5, 1, 20, 12, 34, 0, time.Local),
time.Date(2015, 5, 1, 20, 12, 34, 0, time.UTC),
"timestamp: 2015.05.01",
},
{
"test timestamp formatter",
"%{[@timestamp]}: %{+YYYY.MM.dd}",
common.MapStr{"key": "timestamp"},
time.Date(2015, 5, 1, 20, 12, 34, 0, time.Local),
time.Date(2015, 5, 1, 20, 12, 34, 0, time.UTC),
"2015-05-01T20:12:34.000Z: 2015.05.01",
},
}
Expand Down

0 comments on commit de0a916

Please sign in to comment.