Skip to content

Commit

Permalink
Fix ejabberd_sm unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
NelsonVides committed May 19, 2021
1 parent ce1e8c7 commit 9da7543
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions test/ejabberd_sm_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ cannot_reproduce_race_condition_in_store_info(C) ->
ok = try_to_reproduce_race_condition(C).

store_info_sends_message_to_the_session_owner(C) ->
SID = {erlang:timestamp(), self()},
SID = {erlang:system_time(microsecond), self()},
U = <<"alice2">>,
S = <<"localhost">>,
R = <<"res1">>,
Expand All @@ -255,7 +255,7 @@ store_info_sends_message_to_the_session_owner(C) ->
?B(C):create_session(U, S, R, Session),
%% but call store_info from another process
JID = jid:make_noprep(U, S, R),
spawn_link(fun() -> ejabberd_sm:store_info(JID, {cc, undefined}) end),
spawn_link(fun() -> ejabberd_sm:store_info(JID, cc, undefined) end),
%% The original process receives a message
receive {store_session_info,
#jid{luser = User, lserver = Server, lresource = Resource},
Expand Down Expand Up @@ -412,9 +412,9 @@ given_session_opened(Sid, {U, S, R}, Priority, Info) ->
when_session_opened(Sid, {U, S, R}, Priority, Info) ->
given_session_opened(Sid, {U, S, R}, Priority, Info).

when_session_info_stored(U, S, R, {_,_}=KV) ->
when_session_info_stored(U, S, R, {K,V}) ->
JID = jid:make_noprep(U, S, R),
ejabberd_sm:store_info(JID, KV).
ejabberd_sm:store_info(JID, K, V).

when_session_info_removed(U, S, R, Key) ->
JID = jid:make_noprep(U, S, R),
Expand Down

0 comments on commit 9da7543

Please sign in to comment.