Merge pull request #10647 from hashicorp/b-fix-nomad-event-endpoint-tests

events: fix event endpoint tests to ignore heartbeats.
This commit is contained in:
James Rasell 2021-05-24 14:40:12 +02:00 committed by GitHub
commit b2ef3acff5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,6 +1,7 @@
package nomad
import (
"bytes"
"context"
"encoding/json"
"fmt"
@ -96,7 +97,7 @@ OUTER:
}
// ignore heartbeat
if msg.Event == stream.JsonHeartbeat {
if bytes.Equal(msg.Event.Data, stream.JsonHeartbeat.Data) {
continue
}
@ -283,7 +284,7 @@ OUTER:
t.Fatalf("Got error: %v", msg.Error.Error())
}
if msg.Event == stream.JsonHeartbeat {
if bytes.Equal(msg.Event.Data, stream.JsonHeartbeat.Data) {
continue
}