Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Make tests pass on buildbot more of the time #202

Merged
merged 1 commit into from

2 participants

@Vagabond
Collaborator
  • Stop goldrush application as part of cleanup
  • Mindlessly twidde timeouts
  • Massage mailboxes
@Vagabond
Collaborator
@seancribbs seancribbs self-assigned this
@seancribbs

Tests pass, seems to be a good idea to stop all related apps that were started during the tests.

@Vagabond Vagabond merged commit 0e2ed22 into master
@seancribbs seancribbs deleted the adt-buildbot-fixes branch
@seancribbs seancribbs removed their assignment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Feb 12, 2014
  1. @Vagabond
This page is out of date. Refresh to see the latest.
View
2  src/lager_console_backend.erl
@@ -175,6 +175,7 @@ console_log_test_() ->
unregister(user),
register(user, User),
application:stop(lager),
+ application:stop(goldrush),
error_logger:tty(true)
end,
[
@@ -388,6 +389,7 @@ set_loglevel_test_() ->
end,
fun(_) ->
application:stop(lager),
+ application:stop(goldrush),
error_logger:tty(true)
end,
[
View
1  src/lager_crash_log.erl
@@ -253,6 +253,7 @@ filesystem_test_() ->
end,
file:delete("crash_test.log"),
application:stop(lager),
+ application:stop(goldrush),
error_logger:tty(true)
end,
[
View
4 src/lager_file_backend.erl
@@ -476,6 +476,7 @@ filesystem_test_() ->
file:delete("test.log.0"),
file:delete("test.log.1"),
application:stop(lager),
+ application:stop(goldrush),
error_logger:tty(true)
end,
[
@@ -607,7 +608,7 @@ filesystem_test_() ->
?assertEqual({ok, <<>>}, file:read_file("test.log")),
lager:log(info, self(), "Test message1"),
?assertEqual({ok, <<>>}, file:read_file("test.log")),
- timer:sleep(1000),
+ timer:sleep(2000),
{ok, Bin} = file:read_file("test.log"),
?assert(<<>> /= Bin)
end
@@ -722,6 +723,7 @@ formatting_test_() ->
file:delete("test.log"),
file:delete("test2.log"),
application:stop(lager),
+ application:stop(goldrush),
error_logger:tty(true)
end,
[{"Should have two log files, the second prefixed with 2>",
View
2  src/lager_handler_watcher.erl
@@ -134,6 +134,7 @@ reinstall_on_initial_failure_test_() ->
?assert(lists:member(lager_crash_backend, gen_event:which_handlers(lager_event)))
after
application:stop(lager),
+ application:stop(goldrush),
error_logger:tty(true)
end
end
@@ -162,6 +163,7 @@ reinstall_on_runtime_failure_test_() ->
?assertEqual(false, lists:member(lager_crash_backend, gen_event:which_handlers(lager_event)))
after
application:stop(lager),
+ application:stop(goldrush),
error_logger:tty(true)
end
end
View
1  src/lager_util.erl
@@ -629,6 +629,7 @@ check_trace_test() ->
{[{module, '*'}], config_to_mask('!=notice'), anythingbutnotice}
], [])),
application:stop(lager),
+ application:stop(goldrush),
ok.
is_loggable_test_() ->
View
13 test/lager_test_backend.erl
@@ -511,7 +511,7 @@ lager_test_() ->
{"record printing fails gracefully when module is invalid",
fun() ->
spawn(fun() -> lager:info("State ~p", [lager:pr({state, 1}, not_a_module)]) end),
- timer:sleep(100),
+ timer:sleep(1000),
{Level, _Time, Message, _Metadata} = pop(),
?assertMatch(Level, lager_util:level_to_num(info)),
?assertEqual("State {state,1}", lists:flatten(Message)),
@@ -566,6 +566,7 @@ setup() ->
cleanup(_) ->
application:stop(lager),
+ application:stop(goldrush),
error_logger:tty(true).
@@ -620,6 +621,7 @@ error_logger_redirect_crash_test_() ->
fun(_) ->
application:stop(lager),
+ application:stop(goldrush),
case whereis(crash) of
undefined -> ok;
Pid -> exit(Pid, kill)
@@ -669,6 +671,7 @@ error_logger_redirect_test_() ->
fun(_) ->
application:stop(lager),
+ application:stop(goldrush),
error_logger:tty(true)
end,
[
@@ -1158,13 +1161,15 @@ async_threshold_test_() ->
error_logger:tty(false),
application:load(lager),
application:set_env(lager, error_logger_redirect, false),
- application:set_env(lager, async_threshold, 10),
+ application:set_env(lager, async_threshold, 2),
+ application:set_env(lager, async_threshold_window, 1),
application:set_env(lager, handlers, [{?MODULE, info}]),
lager:start()
end,
fun(_) ->
application:unset_env(lager, async_threshold),
application:stop(lager),
+ application:stop(goldrush),
error_logger:tty(true)
end,
[
@@ -1186,7 +1191,9 @@ async_threshold_test_() ->
%% serialize ont the mailbox again
_ = gen_event:which_handlers(lager_event),
%% just in case...
- timer:sleep(100),
+ timer:sleep(1000),
+ lager:info("hello world"),
+ _ = gen_event:which_handlers(lager_event),
%% async is true again now that the mailbox has drained
?assertEqual(true, lager_config:get(async)),
Something went wrong with that request. Please try again.