Skip to content

Commit 0f06b23

Browse files
committed
Fix tests
1 parent 8ad39d6 commit 0f06b23

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

agent/agent_test.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,10 @@ func TestAgent_Stats_SSH(t *testing.T) {
6868
session, err := sshClient.NewSession()
6969
require.NoError(t, err)
7070
defer session.Close()
71-
require.NoError(t, session.Run("echo test"))
71+
stdin, err := session.StdinPipe()
72+
require.NoError(t, err)
73+
err = session.Shell()
74+
require.NoError(t, err)
7275

7376
var s *agentsdk.Stats
7477
require.Eventuallyf(t, func() bool {
@@ -78,6 +81,9 @@ func TestAgent_Stats_SSH(t *testing.T) {
7881
}, testutil.WaitLong, testutil.IntervalFast,
7982
"never saw stats: %+v", s,
8083
)
84+
_ = stdin.Close()
85+
err = session.Wait()
86+
require.NoError(t, err)
8187
}
8288

8389
func TestAgent_Stats_ReconnectingPTY(t *testing.T) {

codersdk/deployment.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -554,12 +554,12 @@ type WorkspaceConnectionLatencyMS struct {
554554
type DeploymentStats struct {
555555
// AggregatedFrom is the time in which stats are aggregated from.
556556
// This might be back in time a specific duration or interval.
557-
AggregatedFrom time.Time `json:"aggregated_since"`
557+
AggregatedFrom time.Time `json:"aggregated_since" format:"date-time"`
558558
// CollectedAt is the time in which stats are collected at.
559-
CollectedAt time.Time `json:"collected_at"`
559+
CollectedAt time.Time `json:"collected_at" format:"date-time"`
560560
// RefreshingAt is the time when the next batch of stats will
561561
// be refreshed.
562-
RefreshingAt time.Time `json:"refreshing_at"`
562+
RefreshingAt time.Time `json:"refreshing_at" format:"date-time"`
563563

564564
PendingWorkspaces int64 `json:"pending_workspaces"`
565565
BuildingWorkspaces int64 `json:"building_workspaces"`

0 commit comments

Comments
 (0)