Skip to content

bug: coder stat cpu returns used=0 #8091

Closed
@mtojek

Description

@mtojek

We guess that there might be a bug in evaluating the used % of CPU, which was also spotted by CI. Actually, it's fairly easy to reproduce it:

$ go test -timeout 120s -run ^TestStatCPUCmd$ github.com/coder/coder/cli -short -coverpkg=./... -count 10
--- FAIL: TestStatCPUCmd (0.00s)
    --- FAIL: TestStatCPUCmd/JSON (10.10s)
        clitest.go:71: invoking command: coder --global-config /tmp/TestStatCPUCmdJSON2757059279/001 stat cpu --output=json
        stat_test.go:98:
                Error Trace:    /Users/mtojek/code/coder/cli/stat_test.go:98
                Error:          Condition never satisfied
                Test:           TestStatCPUCmd/JSON
...

I will disable the relevant test.

cc @johnstcn (once you're back from holidays)

Metadata

Metadata

Assignees

Labels

s3Bugs that confuse, annoy, or are purely cosmetic

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions