anchor.diff:  prepare_auto_cleaning(Config, InitialData, TestData) ->
       FailingProvider = kv_utils:get(failing_provider, InitialData),
       [FailingNode | _] = test_config:get_provider_nodes(Config, FailingProvider),
  -    [SpaceId | _] = test_config:get_provider_spaces(Config, FailingProvider),
  -    [User1] = test_config:get_provider_users(Config, FailingProvider),
  -    SessId = fun(P) -> test_config:get_user_session_id_on_provider(Config, User1, P) end,
  +    SpaceId = kv_utils:get(space_id, InitialData),
  +    SessId = kv_utils:get([session_ids, FailingProvider], InitialData),
       SpaceGuid = fslogic_uuid:spaceid_to_space_dir_guid(SpaceId),
   
  -    ok = rpc:call(FailingNode, file_popularity_api, enable, [SpaceId]),
  +    enable_file_popularity(FailingNode, SpaceId),
       block_auto_cleaning(FailingNode),
  -    ok = rpc:call(FailingNode, autocleaning_api, configure, [SpaceId, #{enabled => true, target => 0}]),
  -
  -    {ok, {_, Handle}} = lfm_proxy:create_and_open(FailingNode, SessId(FailingProvider), SpaceGuid,
  +    configure_auto_cleaning(FailingNode, SpaceId, #{enabled => true, target => 0}),
  +
  +    {ok, {_, Handle}} = lfm_proxy:create_and_open(FailingNode, SessId, SpaceGuid,
           generator:gen_name(), 8#664),
       {ok, _} = lfm_proxy:write(FailingNode, Handle, 0, ?FILE_TEST_CONTENT),
       lfm_proxy:close(FailingNode, Handle),
  -    ?assertEqual(true, rpc:call(FailingNode, space_quota, current_size, [SpaceId]) > 0 , ?ATTEMPTS),
  -
  -    {ok, ARId} = rpc:call(FailingNode, autocleaning_api, force_run, [SpaceId]),
  +    ?assertEqual(true, get_current_space_quota(FailingNode, SpaceId) > 0 , ?ATTEMPTS),
  +
  +    {ok, ARId} = force_auto_cleaning_run(FailingNode, SpaceId),
   
       TestData#{autocleaning_run_id => ARId}.
   
  
positive.code: %%% Verification functions
  %%%===================================================================
  
  verify_files(Config, InitialData, TestData, StopAppBeforeKill) ->
      Providers = [P1, P2] = test_config:get_providers(Config),
      [User1] = test_config:get_provider_users(Config, P1),
      SessId = fun(P) -> test_config:get_user_session_id_on_provider(Config, User1, P) end,
      [SpaceId | _] = test_config:get_provider_spaces(Config, P1),
      SpaceGuid = fslogic_uuid:spaceid_to_space_dir_guid(SpaceId),
      FailingProvider = kv_utils:get(failing_provider, InitialData),
      [NotFailingProvider] = Providers -- [FailingProvider],
      [FailingNode] = test_config:get_provider_nodes(Config, FailingProvider),
      [NotFailingNode] = test_config:get_provider_nodes(Config, NotFailingProvider),
      verify_all_files_and_dirs_created_by_provider(NotFailingNode, SessId(NotFailingProvider), TestData, NotFailingProvider),
  
      case StopAppBeforeKill of
          true ->
              % App was stopped before node killing - all data should be present
              verify_all_files_and_dirs_created_by_provider(FailingNode, SessId(FailingProvider), TestData, NotFailingProvider),
              verify_all_files_and_dirs_created_by_provider(FailingNode, SessId(FailingProvider), TestData, FailingProvider),
              verify_all_files_and_dirs_created_by_provider(NotFailingNode, SessId(NotFailingProvider), TestData, FailingProvider);
          false ->
              % App wasn't stopped before node killing - some data can be lost
              % but operations on dirs should be possible,
              P1DirGuid = kv_utils:get([test_dirs, P1], InitialData),
              P2DirGuid = kv_utils:get([test_dirs, P2], InitialData),
              test_new_files_and_dirs_creation(Config, SpaceGuid),
              test_new_files_and_dirs_creation(Config, P1DirGuid),
              test_new_files_and_dirs_creation(Config, P2DirGuid)
      end.
  
  verify_import(Config, InitialData, TestData) ->
      ImportingProvider = kv_utils:get(failing_provider, InitialData),
      [ImportingOpNode | _] = test_config:get_provider_nodes(Config, ImportingProvider),
      [SpaceId | _] = test_config:get_provider_spaces(Config, ImportingProvider),
  
      % check whether scan is correctly restarted after node restart
      % get last finished scan
  
negative.code:     ok = test_utils:mock_new(OpwNode, autocleaning_view_traverse),
      ok = test_utils:mock_expect(OpwNode, autocleaning_view_traverse, process_row, fun(_Row, _Info, _RowNumber) ->
          timer:sleep(timer:minutes(10))
      end).
  
  get_current_space_quota(Node, SpaceId) ->
      rpc:call(Node, space_quota, current_size, [SpaceId]).
  
  enable_file_popularity(Node, SpaceId) ->
      ok = rpc:call(Node, file_popularity_api, enable, [SpaceId]).
  
  configure_auto_cleaning(Node, SpaceId, Config) ->
      ok = rpc:call(Node, autocleaning_api, configure, [SpaceId, Config]).
  
  force_auto_cleaning_run(Node, SpaceId) ->
      rpc:call(Node, autocleaning_api, force_run, [SpaceId]).
  
  get_auto_cleaning_run_report(Node, ARId) ->
      rpc:call(Node, autocleaning_api, get_run_report, [ARId]).
  
  add_session_ids(Config, InitialData) ->
      [P1, P2] = test_config:get_providers(Config),
      [User1] = test_config:get_provider_users(Config, P1),
      SessId = fun(P) -> test_config:get_user_session_id_on_provider(Config, User1, P) end,
      InitialData#{
          session_ids => #{
              P1 => SessId(P1),
              P2 => SessId(P2)
          }
      }.