mirror of
https://github.com/kemko/nomad.git
synced 2026-01-04 01:15:43 +03:00
Merge pull request #1473 from hashicorp/f-node-status-updated-ts
Added a test
This commit is contained in:
@@ -6,6 +6,7 @@ import (
|
||||
"sort"
|
||||
"strings"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/hashicorp/nomad/testutil"
|
||||
)
|
||||
@@ -79,6 +80,7 @@ func TestNodes_PrefixList(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestNodes_Info(t *testing.T) {
|
||||
startTime := time.Now().Unix()
|
||||
c, s := makeClient(t, nil, func(c *testutil.TestServerConfig) {
|
||||
c.DevMode = true
|
||||
})
|
||||
@@ -121,6 +123,11 @@ func TestNodes_Info(t *testing.T) {
|
||||
nodeID, dc,
|
||||
result.ID, result.Datacenter)
|
||||
}
|
||||
|
||||
// Check that the StatusUpdatedAt field is being populated correctly
|
||||
if result.StatusUpdatedAt < startTime {
|
||||
t.Fatalf("start time: %v, status updated: %v", startTime, result.StatusUpdatedAt)
|
||||
}
|
||||
}
|
||||
|
||||
func TestNodes_ToggleDrain(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user