-
-
Notifications
You must be signed in to change notification settings - Fork 345
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GitHub test runner doesn't like the new NetAsyncDownloader test #3906
Comments
Going by the basic code flow, the outcome on GitHub should be impossible. The main thread waits for notification of completion of all downloads, before the test assertions are run: CKAN/Core/Net/NetAsyncDownloader.cs Lines 174 to 178 in 5588442
... which is sent by the final download, when the completed download count reaches the total number of downloads: CKAN/Core/Net/NetAsyncDownloader.cs Lines 349 to 353 in 5588442
CKAN/Core/Net/NetAsyncDownloader.cs Lines 482 to 490 in 5588442
... which comes sequentially after all of the sizes have been set when their respective threads finish: CKAN/Core/Net/NetAsyncDownloader.cs Lines 458 to 464 in 5588442
Maybe there's some sort of inter-thread marshalling delay in target objects being updated? If that's the case, we might have to send them through another synchronization primitive to ensure they arrive safely and then have the main thread set them itself... |
Also of note, this exact code is working perfectly fine in dozens of other tests, because it underlies the That 30% failure rate smells like a race condition. But we are already handling synchronization. |
Another possibility is a delay between when |
Ooh, if I add 9 more files to the test, my Ubuntu VM is able to reproduce the problem! Also added more asserts, and "Sizes on disk should match originals" means that the test itself is seeing the wrong sizes on disk, so it's not a question of |
New guess: Since the ... I think that's it!! 🕺 |
Problem
#3904 made the
NetAsyncDownloader
set thetarget.size
for the files it downloads as a conveniece for calling code (in this case, so theRepositoryDataManger
could report updates for progress bars while loading) and added tests for it (withfile://
URLs so we could always run them despite a flaky network).I investigated this extensively yesterday and thought that we resolved it by upgrading
NUnit-ConsoleRunner
from 3.11.1 to 3.12.0, but apparently it still happens.I am worried that this is somehow finding a real problem that could blow up once the release ships.
The text was updated successfully, but these errors were encountered: