Skip to content

Fix pkg/streamformatter.TestJSONFormatProgress#23120

Merged
LK4D4 merged 1 commit intomoby:masterfrom
AkihiroSuda:fixStreamFormatter
Jun 1, 2016
Merged

Fix pkg/streamformatter.TestJSONFormatProgress#23120
LK4D4 merged 1 commit intomoby:masterfrom
AkihiroSuda:fixStreamFormatter

Conversation

@AkihiroSuda
Copy link
Member

This is an addendum to #23113.

- What I did
Fix pkg/streamformatter.TestJSONFormatProgress, which was failing if the terminal column width is <= 110.

$ go test -c ./pkg/streamformatter && go test -v ./streamformatter.test
--- FAIL: TestJSONFormatProgress (0.00s)
        streamformatter_test.go:98: ProgressMessage without the timeLeftBox must be [=========================>                         ]     15 B/30 B, got:     15 B/30 B 406857h10m55s
FAIL

- How I did it
Check the terminal window size

- How to verify it

  1. Set the terminal column ($COLUMNS) to <= 110 so as to confirm the issue is resolved
$ echo $COLUMNS
$ go test -c ./pkg/streamformatter && go test -v ./streamformatter.test
  1. Set the terminal column ($COLUMNS) to > 110 so as to confirm there is no regression.
$ echo $COLUMNS
$ go test -v ./streamformatter.test
  1. Run with nohup as well
$ nohup go test -v ./streamformatter.test && cat nohup.out

Signed-off-by: Akihiro Suda suda.akihiro@lab.ntt.co.jp

The test was failing if the terminal column width is <= 110.

Addendum to moby#23113

Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
@thaJeztah
Copy link
Member

nice catch :)

LGTM

@LK4D4
Copy link
Contributor

LK4D4 commented Jun 1, 2016

@AkihiroSuda Thanks! LGTM

@LK4D4 LK4D4 merged commit 2ca2530 into moby:master Jun 1, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants