Skip to content

downloader: duplicate downloads in parallel case #242

@tikkss

Description

@tikkss

Steps to reproduce

Clear the cache for example AFINN and then runs the tests in thread-parallel mode:

$ ruby -e 'require "datasets"; Datasets::AFINN.new.clear_cache!' && ruby test/run.rb -t AFINNTest --parallel=thread

Expected result

Only one download of imm6010.zip happens during the test run:

Loaded suite test
Started
imm6010.zip - 100.0% [ 16.23KB/ 16.23KB] 00:00:00   7KB/s
Finished in 9.103834 seconds.
---------------------------------------------------------------------------------
2 tests, 2 assertions, 0 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications
100% passed
---------------------------------------------------------------------------------
0.22 tests/s, 0.22 assertions/s

Actual result

The same file imm6010.zip is downloaded twice:

Loaded suite test
Started
imm6010.zip - 100.0% [ 16.23KB/ 16.23KB] 00:00:00   7KB/s
imm6010.zip - 100.0% [ 16.23KB/ 16.23KB] 00:00:00   7KB/s
Finished in 7.941769 seconds.
---------------------------------------------------------------------------------
2 tests, 2 assertions, 0 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications
100% passed
---------------------------------------------------------------------------------
0.25 tests/s, 0.25 assertions/s

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions