eclipse-cdt-cloud / eclipse-cdt-cloud/cdt-gdb-adapter
Flaky launchRemoteUnexpectedExit tests
- Dominant language
- TypeScript
- Stars
- 39
- Forks
- 56
- Avg merge
- 3d 9h
- Merged PRs (30d)
- 2
Description
I find that, when I run tests locally, the two tests
```
launch remote unexpected session exit/remote/sends error response and terminates GDB server if incorrect GDB CLI arg
launch remote unexpected session exit/remote/sends error response if incorrect GDB server CLI arg
```
from [_src/integration-tests/launchRemoteUnexpectedExit.spec.ts_](https://github.com/eclipse-cdt-cloud/cdt-gdb-adapter/blob/6a015e03709e36e93bdc7903c3602b8474a042f4/src/integration-tests/launchRemoteUnexpectedExit.spec.ts#L144) occasionally fail in their final assert, about 1 in 10 to 1 in 3 times. They do not find the expected output because `stdOutput` is `[]` at the time. The reason seems to be that the `{ category: 'server', output: 'gdbserver exited with code 1\n' }` event that is awaited with `outputPromise` comes before any `{ category: 'stdout' …` events whose contents are collected, so the check is done too early. Apparently there is no deterministic order between these events.
I am not sure whether that in itself is a bug or whether that is just an unreliable way of setting up the test, and what a better way would be, so I have not come up with a solution yet. I would prefer not putting more effort into it right now, rather I am hoping @jreineckearm who wrote most of this has a better idea of how it is supposed to work.
Also, these two tests are identical. I suspect that is a copy-paste error.
Contributor guide
Assessment
This issue has not been assessed yet.