KAFKA-10083: fix failed testReassignmentWithRandomSubscriptionsAndChanges tests#8778
KAFKA-10083: fix failed testReassignmentWithRandomSubscriptionsAndChanges tests#8778showuon wants to merge 1 commit intoapache:trunkfrom
Conversation
|
@ableegoldman , could you review this PR to fix the failed tests? Thanks. |
| public static final int DEFAULT_GENERATION = -1; | ||
|
|
||
| private PartitionMovements partitionMovements = new PartitionMovements(); | ||
| private PartitionMovements partitionMovements; |
There was a problem hiding this comment.
Can we still initialize it here as well? I remember that was necessary for some tests to pass since they might never get to the generalAssign method and isSticky would hit NPE
On the other hand, it seems like isSticky is pointless to call unless we get to the generalAssign method. So maybe we should just remove that from the tests that only do the constrainedAssign and just verify the stickiness directly?
|
cc @mjsax @guozhangwang , should be cherrypicked to 2.6, 2.5, and 2.4 (once my comment above is addressed) |
|
ok to test |
|
Hey @showuon, this failing test has been blocking others so I submitted a quick PR to fix it ASAP: #8786 But as noted in the PR and in my earlier comment here, this is just the "minimum fix". I think ideally we would improve the tests to not just rely on |
The failed test is because we changed the class member
partitionMovementsinitialization to when the class instance created, from initialized when used withinassignmethod. This won't have any issue when 1st used theAbstractStickyAssignorinstance. But if it is used later, thepartitionMovementswill store the old info, and cause this failed tests. Fix it by moving thepartitionMovementsinitialization back toassignmethod.Committer Checklist (excluded from commit message)