Karm / mandrel-integration-tests

Integration tests for GraalVM and its Mandrel distribution. Runs Quarkus, Helidon and Micronaut applications and small targeted reproducers. The focus is solely on native-image utility and compilation of Java applications into native executables.
Apache License 2.0
5 stars 3 forks source link

Revisit how gdb output is checked #157

Closed zakkak closed 1 year ago

zakkak commented 1 year ago

GDB output is checked with a timeout of 10 seconds, which seems reasonable:

https://github.com/Karm/mandrel-integration-tests/blob/eb6a37ad682bf3ed9c92362d89cc80b7f38b9912/testsuite/src/it/java/org/graalvm/tests/integration/DebugSymbolsTest.java#L414

The issue is that apparently this results in misleading error messages on timeout, e.g.:

In https://github.com/graalvm/mandrel/actions/runs/4932214298/jobs/8815389640#step:10:19429 we get

Command 'b ConfigTestController.java:33' did not match the expected pattern '.*Breakpoint 1 at .*: file com/example/quarkus/config/ConfigTestController.java, line 33.*'.
Output was:
(gdb) (gdb) (gdb) GNU gdb (Ubuntu 12.1-0ubuntu1~22.04) 12.1
Copyright (C) 2022 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word".

The output that is shown is from the previous gdb command show version.

My understanding is that waitForBufferToMatch returns immediately in the case of show version since the pattern will match anything (even no output), as a result if gdb takes more than 10 seconds to run b ConfigTestController.java:33 and produces no output we will most probably observe the output from show version.