<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/102264>102264</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
gtest sharding breaks lit's xfail inputs
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
kendalharland
</td>
</tr>
</table>
<pre>
Lit marks tests as XFAIL by generating a list of `discovered_tests` and marking each of them as xfail if their file or fullnames appear in its `opts.xfail` CLI arguments. When gtest sharding is enabled, every test in `discovered_tests` contains a numeric suffix like `FooTest\1\2`. The numbers are new for each build invocation. Once the tests are finished running, the `googletest` module will fil in with the actual test suite and case names by reading them from gtest json files only _after_ the tests are run. The resulting test name might look like `FooTest/TestSuite/TestCase`.
This completely breaks the functionality of lit's `--xfail-tests` flag and `LIT_XFAIL` environment variables, where the user is expected to pass the test's name they see in the console: `FooTest/TestSuite/TestCase`, because lit attempts to mark the test as XFAIL too early.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyMVE9rKzcQ_zTyZYhRZHttH_aQ-mEIBHpooL2FWe3srl600qKRnPjbl5H98sorhfpgGWv-_f5okNmNgahVu9_U7tsKS55iat8p9OgnTB5Dv-pif21fXIYZ0ztDJs4MyPDX-en5BborjBQoYXZhBATvOEMcQDW6d2zjhRL1bzVJNRow9LWOBBPaSULzRLMU_BzQeXD1D5dgcJ4gJhiK9wFnYsBlIUzgArjM0iEumdc1TWqfXp4B01hmCpnX8OdEAUbpDDxh6qWlY6CAnademRPQhdK1ApKa_zGxjSGjCwwIocyUnAUuw-A-wbt3kqxzjK_EWe1Oj2p3MqrRa3idSMI7SgyYCAJ9wBDTDXNXnO_BhUu0mF0Ma_g9WBLYP9hNBIMLjifqIZUQXBhlYIlQjR5jHD1JqAw4x754gg_nvXAmUD5cnmow2lzQ3yBycZmqABaZ4EZpd4VEWLmpMgwpznfSvnMMVQSGGPwV3nDIlN5-GTOVcEObiIuvJqjZUh5mN04ZfIzv_yLLnOX4Q2a6_z4hU-VO6W9KP92-XyfHYOO8CF5_hS4RigkngqEEK-yhd_kqPvIuK7Ovxnh4qK54-FJx8DhW7KrRL8-vb9W8ckHh4lIM4hm4YHJiDhauPyZKN00KU6rO-VzIZuohR1iQ-YuJ2rUCzhNdgYlEBLm1MXD0pDZP_wu79O3IYmESNIA507xklo7yar46_nx_OUYgTP66_idtsOrbTX_cHHFF7ePemKN8dqup7YdHTY22x0PTb-iw3VNndNdY3XR6s6ftyrVGm60-6L3e6GazW3eIaOlgtpvjYTA9qq2mGZ1fe3-Z1zGNK8dcqH3UxjTblceOPNeNYozYvt4qY2TBpFaSHroystpq2RX8s0x22VP7y4u9C_5D2_uOCEvJvCrJt1POC6vNkzJnZc6jy1Pp1jbOypyl8P14WFL8Tlaor-OwMuf7vJfW_B0AAP__oAy2jQ">