Keyboard tests sometimes failing (one letter is typed multiple times)

It seems, that sometimes there is big delay between key down and key up, which causes keyboard tests to fail.

    Error Message
    expected:<t[]est123> but was:<t[ttttttt]est123>

I've only seen it on linux so far, but it doesn't mean, that it couldn't happen somewhere else.