Bug in the tests of BackgroundExecutor.cancelAll #1921
Comments
FYI, the PR branch is over there. Please don't merge yet ! |
Especially as my fix did almost nothing to fix the uselessness of the test. Now, it's better : for (int i = 0; i < list.size(); i++) {
Assert.assertTrue("Items must be only from uncancelled tasks", list.get(i) < NB_ADD);
} |
Okay, I delved deeper into Refs:
And an interesting reading about safely cancelling tasks in executors : https://10kloc.wordpress.com/2013/12/24/cancelling-tasks-in-executors/
Should I make a PR for the tests fix ? (note: I'm still struggling with git rebases, so if you want me to rebase or something you'll need to hold my hand or make me RTFM) |
@Goutte sorry for the very late response, but if you are still interested, PRs are always welcome. :) |
I noticed that
BackgroundExecutor.cancelAll
did not work for me in the field, with the latest build fromdevelop
.I had had a look at the tests earlier, and saw these two assertions, that I thought were useless. I mean, there is no use of the
list
in either of the assertions.So I tried to "fix" (still unsure about what I'm doing) them by replacing
NB_ADD
bylist.size()
in thefor
's exit condition :The tests still pass, but I'm still having trouble in my own in-the-field tests,
possibly because I'm trying to cancel a task that is already running (a very long http request). I quintuple-checked that I'm using proper ids this time.I can make a PR for the small fix of the tests, but I'd rather get to the bottom of why it ain't working for me first, by trying to reproduce this in the test-suite.
The text was updated successfully, but these errors were encountered: