Skip to content

Fix the test to deal with non-deterministic output. #96800

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 28, 2024

Conversation

clayborg
Copy link
Collaborator

When we check for the "struct CustomType" in the NODWP, we can just make sure that we have both types showing up, the next tests will validate the types are correct. Also added a "-DAG" to the integer and float types. This should fix the flakiness in this test.

When we check for the "struct CustomType" in the NODWP, we can just make sure that we have both types showing up, the next tests will validate the types are correct. Also added a "-DAG" to the integer and float types. This should fix the flakiness in this test.
@clayborg clayborg requested a review from labath June 26, 2024 17:14
@clayborg clayborg requested a review from JDevlieghere as a code owner June 26, 2024 17:14
@llvmbot llvmbot added the lldb label Jun 26, 2024
@llvmbot
Copy link
Member

llvmbot commented Jun 26, 2024

@llvm/pr-subscribers-lldb

Author: Greg Clayton (clayborg)

Changes

When we check for the "struct CustomType" in the NODWP, we can just make sure that we have both types showing up, the next tests will validate the types are correct. Also added a "-DAG" to the integer and float types. This should fix the flakiness in this test.


Full diff: https://github.com/llvm/llvm-project/pull/96800.diff

1 Files Affected:

  • (modified) lldb/test/Shell/SymbolFile/DWARF/x86/dwp-foreign-type-units.cpp (+6-16)
diff --git a/lldb/test/Shell/SymbolFile/DWARF/x86/dwp-foreign-type-units.cpp b/lldb/test/Shell/SymbolFile/DWARF/x86/dwp-foreign-type-units.cpp
index 8dd5a5472ed4c..4df1b33dd7d91 100644
--- a/lldb/test/Shell/SymbolFile/DWARF/x86/dwp-foreign-type-units.cpp
+++ b/lldb/test/Shell/SymbolFile/DWARF/x86/dwp-foreign-type-units.cpp
@@ -30,24 +30,14 @@
 // RUN:   -o "type lookup CustomType" \
 // RUN:   -b %t | FileCheck %s --check-prefix=NODWP
 // NODWP: (lldb) type lookup IntegerType
-// NODWP-NEXT: int
-// NODWP-NEXT: unsigned int
+// NODWP-DAG: int
+// NODWP-DAG: unsigned int
 // NODWP: (lldb) type lookup FloatType
-// NODWP-NEXT: double
-// NODWP-NEXT: float
+// NODWP-DAG: double
+// NODWP-DAG: float
 // NODWP: (lldb) type lookup CustomType
-// NODWP-NEXT: struct CustomType {
-// NODWP-NEXT:     typedef int IntegerType;
-// NODWP-NEXT:     typedef double FloatType;
-// NODWP-NEXT:     CustomType::IntegerType x;
-// NODWP-NEXT:     CustomType::FloatType y;
-// NODWP-NEXT: }
-// NODWP-NEXT: struct CustomType {
-// NODWP-NEXT:     typedef unsigned int IntegerType;
-// NODWP-NEXT:     typedef float FloatType;
-// NODWP-NEXT:     CustomType::IntegerType x;
-// NODWP-NEXT:     CustomType::FloatType y;
-// NODWP-NEXT: }
+// NODWP: struct CustomType {
+// NODWP: struct CustomType {
 
 // Check when we make the .dwp file with %t.main.dwo first so it will
 // pick the type unit from %t.main.dwo. Verify we find only the types from

@vvereschaka
Copy link
Contributor

@clayborg ,
the test is still flaky with these changes on the windows build/target host. Here are two failed test outputs. They are a bit different.

failure 1:

# executed command: 'd:\projects\llvm-project\lldb\build-lldb-win\bin\filecheck.exe' 'D:\projects\llvm-project\lldb\llvm-project\lldb\test\Shell\SymbolFile\DWARF\x86\dwp-foreign-type-units.cpp' --check-prefix=NODWP
# .---command stderr------------
# | D:\projects\llvm-project\lldb\llvm-project\lldb\test\Shell\SymbolFile\DWARF\x86\dwp-foreign-type-units.cpp:35:11: error: NODWP: expected string not found in input
# | // NODWP: (lldb) type lookup FloatType
# |           ^
# | <stdin>:14:22: note: scanning from here
# |  typedef unsigned int IntegerType;
# |                      ^
# | <stdin>:15:3: note: possible intended match here
# |  typedef float FloatType;
# |   ^
# |
# | Input file: <stdin>
# | Check file: D:\projects\llvm-project\lldb\llvm-project\lldb\test\Shell\SymbolFile\DWARF\x86\dwp-foreign-type-units.cpp
# |
# | -dump-input=help explains the following input dump.
# |
# | Input was:
# | <<<<<<
# |             .
# |             .
# |             .
# |             9: (lldb) type lookup FloatType
# |            10: double
# |            11: float
# |            12: (lldb) type lookup CustomType
# |            13: struct CustomType {
# |            14:  typedef unsigned int IntegerType;
# | check:35'0                          X~~~~~~~~~~~~~ error: no match found
# |            15:  typedef float FloatType;
# | check:35'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~
# | check:35'1       ?                        possible intended match
# |            16:  CustomType::IntegerType x;
# | check:35'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            17:  CustomType::FloatType y;
# | check:35'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            18: }
# | check:35'0     ~~
# |            19: struct CustomType {
# | check:35'0     ~~~~~~~~~~~~~~~~~~~~
# |            20:  typedef int IntegerType;
# | check:35'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~
# |             .
# |             .
# |             .
# | >>>>>>
# `-----------------------------
# error: command failed with exit status: 1

failure 2:

# executed command: 'd:\projects\llvm-project\lldb\build-lldb-win\bin\filecheck.exe' 'D:\projects\llvm-project\lldb\llvm-project\lldb\test\Shell\SymbolFile\DWARF\x86\dwp-foreign-type-units.cpp' --check-prefix=NODWP
# .---command stderr------------
# | D:\projects\llvm-project\lldb\llvm-project\lldb\test\Shell\SymbolFile\DWARF\x86\dwp-foreign-type-units.cpp:35:11: error: NODWP: expected string not found in input
# | // NODWP: (lldb) type lookup FloatType
# |           ^
# | <stdin>:20:22: note: scanning from here
# |  typedef unsigned int IntegerType;
# |                      ^
# | <stdin>:21:3: note: possible intended match here
# |  typedef float FloatType;
# |   ^
# |
# | Input file: <stdin>
# | Check file: D:\projects\llvm-project\lldb\llvm-project\lldb\test\Shell\SymbolFile\DWARF\x86\dwp-foreign-type-units.cpp
# |
# | -dump-input=help explains the following input dump.
# |
# | Input was:
# | <<<<<<
# |             .
# |             .
# |             .
# |            15:  typedef double FloatType;
# |            16:  CustomType::IntegerType x;
# |            17:  CustomType::FloatType y;
# |            18: }
# |            19: struct CustomType {
# |            20:  typedef unsigned int IntegerType;
# | check:35'0                          X~~~~~~~~~~~~~ error: no match found
# |            21:  typedef float FloatType;
# | check:35'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~
# | check:35'1       ?                        possible intended match
# |            22:  CustomType::IntegerType x;
# | check:35'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            23:  CustomType::FloatType y;
# | check:35'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            24: }
# | check:35'0     ~~
# | >>>>>>
# `-----------------------------
# error: command failed with exit status: 1

@clayborg clayborg merged commit f0bffb1 into llvm:main Jun 28, 2024
8 checks passed
@clayborg clayborg deleted the foreign-tus-test-fix branch June 28, 2024 16:44
@DavidSpickett
Copy link
Collaborator

DavidSpickett commented Jul 2, 2024

Linaro has also seen it failing on our Windows on Arm bot: https://lab.llvm.org/buildbot/#/builders/141/builds/425

I've disabled the test on Windows (54811a9) and one of my colleagues is going to look into it.

lravenclaw pushed a commit to lravenclaw/llvm-project that referenced this pull request Jul 3, 2024
When we check for the "struct CustomType" in the NODWP, we can just make
sure that we have both types showing up, the next tests will validate
the types are correct. Also added a "-DAG" to the integer and float
types. This should fix the flakiness in this test.
@ZequanWu
Copy link
Contributor

ZequanWu commented Jul 9, 2024

This also failed for me on Linux. I sent a fix at #98237 which also enables it on windows.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants