@@ -173,20 +173,13 @@ defmodule ExUnit.Server do
173173  end 
174174
175175  defp  take_modules ( % { waiting:  { from ,  count } }  =  state )  do 
176-     has_async_modules?  =  not  :queue . is_empty ( state . async_modules ) 
177-     has_async_groups?  =  state . async_groups  !=  [ ] 
178- 
179176    cond  do 
180-       not  has_async_modules?  and  not  has_async_groups?  and  state . loaded  ==  :done  -> 
181-         GenServer . reply ( from ,  nil ) 
182-         % { state  |  waiting:  nil } 
183- 
184-       has_async_modules?  -> 
177+       not  :queue . is_empty ( state . async_modules )  -> 
185178        { reply ,  remaining_modules }  =  take_until ( count ,  state . async_modules ) 
186179        GenServer . reply ( from ,  reply ) 
187180        % { state  |  async_modules:  remaining_modules ,  waiting:  nil } 
188181
189-       has_async_groups?  -> 
182+       state . async_groups   !=   [ ]   and   state . loaded   ==   :done  -> 
190183        { groups ,  remaining_groups }  =  Enum . split ( state . async_groups ,  count ) 
191184
192185        { reply ,  groups }  = 
@@ -198,6 +191,10 @@ defmodule ExUnit.Server do
198191        GenServer . reply ( from ,  reply ) 
199192        % { state  |  groups:  groups ,  async_groups:  remaining_groups ,  waiting:  nil } 
200193
194+       state . loaded  ==  :done  -> 
195+         GenServer . reply ( from ,  nil ) 
196+         % { state  |  waiting:  nil } 
197+ 
201198      true  -> 
202199        state 
203200    end 
0 commit comments