20862: Add 'sdk/ruby-google-api-client/' from commit '2f4be67955e48bb65d008ecd9ff6da9...
[arvados.git] / lib / crunchstat / crunchstat_test.go
index c369152b827a101addbd42d0c0f7d05e298d5b25..415c58a53388fd9fb68e62885a4b78ad7ef09db7 100644 (file)
@@ -44,6 +44,7 @@ func (s testdatasource) FS() fs.FS {
 //
 //     arvados-server crunchstat -dump ./testdata/example1234 sleep 2
 var testdata = map[string]testdatasource{
+       "debian10":   {fspath: "testdata/debian10", pid: 3288},
        "debian11":   {fspath: "testdata/debian11", pid: 4153022},
        "debian12":   {fspath: "testdata/debian12", pid: 1115883},
        "ubuntu1804": {fspath: "testdata/ubuntu1804", pid: 2523},
@@ -85,7 +86,7 @@ func (s *suite) TestReportCurrent(c *C) {
                `(?ms).*rss.*`,
                `(?ms).*net:.*`,
                `(?ms).*blkio:.*`,
-               `(?ms).* [\d.]+ user [\d.]+ sys ` + fmt.Sprintf("%d", runtime.NumCPU()) + ` cpus -- .*`,
+               `(?ms).* [\d.]+ user [\d.]+ sys ` + fmt.Sprintf("%.2f", float64(runtime.NumCPU())) + ` cpus -- .*`,
        }
        for deadline := time.Now().Add(4 * time.Second); !c.Failed(); time.Sleep(time.Millisecond) {
                done := true
@@ -154,7 +155,7 @@ func (s *suite) TestAllTestdata(c *C) {
                c.Check(logs, Matches, `(?ms).* \d\d+ rss\\n.*`)
                c.Check(logs, Matches, `(?ms).*blkio:\d+:\d+ \d+ write \d+ read\\n.*`)
                c.Check(logs, Matches, `(?ms).*net:\S+ \d+ tx \d+ rx\\n.*`)
-               c.Check(logs, Matches, `(?ms).* [\d.]+ user [\d.]+ sys [2-9]\d* cpus.*`)
+               c.Check(logs, Matches, `(?ms).* [\d.]+ user [\d.]+ sys [2-9]\d*\.\d\d cpus.*`)
        }
 }