list: attempt to fix flaky unit test #4288
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The list tests that involve batching are flaking, mostly (maybe only) on Safari and Firefox.
For the test that I'm seeing flake most often, it's expecting the batch of events to contain 3 events but more often it's 2 and sometimes 1. The biggest source of causing 2 events instead of 3 is that this event is firing too late and though it happens, the
d2l-list-selection-changes
event will have already fired without it.To me, this isn't necessarily wrong behaviour just not ideal. I've increase the
setTimeout
time that we wait before triggering the batch event. Let me know if the30
was an important value. I've also got changes to the test working where we wait for selection to have been included in ad2l-list-selection-changes
event depending on how many events are in, but that code is super verbose.I'll run this a bunch of times to see if this change helps here.5 times and so far so good