Skip to content

Commit

Permalink
Merge pull request #108 from fadushin/logger_test_fix
Browse files Browse the repository at this point in the history
The AVM logger module is by design asynchronous.
This change adds a sleep to the retrieval of the counted logs to wait for the
logger sink to be invoked, and hence the counter to be updated.

These changes are made under the terms of the LGPL v2.1 (or any later version)
and Apache 2.0 licenses.
  • Loading branch information
bettio committed Sep 4, 2019
2 parents e20d577 + 487b6e2 commit 1939abf
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions tests/libs/eavmlib/test_logger.erl
Expand Up @@ -74,6 +74,7 @@ increment_counter(Level) ->
Pid ! {increment, Level}.

get_counter(Level) ->
?TIMER:sleep(50),
Pid = erlang:whereis(counter),
Ref = erlang:make_ref(),
Pid ! {self(), Ref, get_counter, Level},
Expand Down

0 comments on commit 1939abf

Please sign in to comment.