Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#28472 fix flaky tests in libbeat fmtstr to use time.UTC instead of time.Local #28473

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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