Commit Graph

26 Commits

Author SHA1 Message Date
James Rasell
f5567b3261 cli: move tests to use NewMockUi func. 2020-10-05 16:07:41 +02:00
Mahmood Ali
af2e2bc7ed cli: sequence cli.Ui operations
Fixes a bug where if a command flag parsing errors, the resulting error
and help usage messages get interleaved in unexpected and non-user
friendly way.

The reason is that we have flag parsing library effectively writes to
ui.Error in a goroutine.  This is problematic: first, we lose the sequencing between help
usage and error message; second, cli.Ui methods are not concurrent safe.

Here, we introduce a custom error writer that buffers result and calls
ui.Error() in the write method and in the same goroutine.

For context, we need to wrap ui.Error because it's line-oriented, while
flags library expects a io.Writer which is bytes oriented.
2019-12-16 10:08:17 -05:00
Lars Lehtonen
2784f166e5 command: fix TestHelpers_LineLimitReader_TimeLimit() goroutine (#6678) 2019-11-12 08:35:11 -05:00
Alex Dadgar
8f47469f5c fix flaky pretty time test 2018-04-03 18:15:12 -07:00
Preetha Appan
69c4a58c34 Show reschedule eligibility time in alloc-status when followup evalid is available 2018-03-14 16:10:32 -05:00
Alex Dadgar
ddee932500 Fix upgrade path of modify time 2017-12-11 15:58:24 -08:00
Preetha Appan
c0e79a164d Fix flaky test TestPrettyTimeDiff 2017-11-16 09:48:14 -06:00
Preetha Appan
9e5f12f8b4 Declare time.Now once to prevent flakiness 2017-11-14 20:32:02 -06:00
Preetha Appan
bc833c9c8c Handle edge case when allocation create/modify time difference is less than a second ago. 2017-11-14 16:40:34 -06:00
Preetha Appan
33475d169a New pretty printer that imitates the short form from time.Duration.String() with approximated values for days and beyond. Used in cli output for allocation create/modify times 2017-11-01 15:16:38 -05:00
Alex Dadgar
a77c6a4f71 Parallel 2017-07-20 21:24:21 -07:00
Alex Dadgar
da25a3d5ce Switch to in-process agent 2017-07-20 21:07:32 -07:00
Alex Dadgar
eaa57878d9 Vendor + test fixes 2017-02-22 15:55:33 -08:00
Alex Dadgar
6debb3e03b Refactor test and fix them 2017-02-16 14:00:41 -08:00
Alex Dadgar
b6e0d12de7 Flatmap 2017-02-16 13:52:39 -08:00
Alex Dadgar
7eac718eea Use RC to see if cause of failure 2017-02-16 13:52:39 -08:00
Diptanu Choudhury
5502a669e8 Added tests 2017-02-16 13:52:39 -08:00
Alex Dadgar
1399cd6293 Fix interval breaking two tests 2017-02-14 17:06:30 -08:00
Kenjiro Nakayama
5edc9d1072 Add StructJob test with jobfile from HTTP Server 2016-08-17 11:06:08 +09:00
Kenjiro Nakayama
bbc6a48596 Rename Helper to JobGetter 2016-08-17 11:06:08 +09:00
Kenjiro Nakayama
d00090ab8b Use go-getter to get jobfile by URL 2016-08-17 11:06:08 +09:00
Alex Dadgar
ac1cfd1821 unblock the readers to add liveness when using -n 2016-07-25 11:16:01 -07:00
Alex Dadgar
991220b5c7 implement -n for tail 2016-07-13 13:26:09 -06:00
Alex Dadgar
e6e3225c5c Add -self flag to node-drain 2016-04-11 15:20:49 -07:00
Ryan Uber
8a57dbacac command: placeholder for <none> in kv output 2015-09-27 14:04:53 -07:00
Ryan Uber
210ee0bbb7 command: helpers for columns 2015-09-15 16:44:38 -07:00