Skip to content
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

Welcome.test.tsx flakiness #41403

Open
ravicious opened this issue May 10, 2024 · 0 comments
Open

Welcome.test.tsx flakiness #41403

ravicious opened this issue May 10, 2024 · 0 comments

Comments

@ravicious
Copy link
Member

Failure

Link(s) to logs

  • No logs because I was running this locally.
for i in {1..100}; do yarn test web/packages/teleport/src/Welcome/Welcome.test.tsx  || {echo "Failed after $i attempts" && break}; done

Relevant snippet

Similar to the other flaky tests I reported today, I think this one fails because it waits for a service to be called instead for HTML to be rendered.

await waitFor(() => {
expect(auth.fetchPasswordToken).toHaveBeenCalled();
});
expect(screen.getByText(/confirm password/i)).toBeInTheDocument();

 FAIL  web/packages/teleport/src/Welcome/Welcome.test.tsx
  ● teleport/components/Welcome › should have correct welcome prompt flow for invite

    TestingLibraryElementError: Unable to find an element with the text: /confirm password/i. This could be because the text is broken up by multiple elements. In this case, you can provide a function for your text matcher to make your matcher more flexible.

    Ignored nodes: comments, script, style
    <body>
      <div>
        <div
          class="sc-gFAWRd efmzxW"
        >
          <div
            class="sc-aXZVg sc-gFqAkR boyTjg kLdgCr"
            height="100%"
          >
            <div
              class="sc-aXZVg sc-gFqAkR iVPXuG jJDvvv"
            >
              <div
                class="sc-aXZVg sc-gmPhUn iVPXuG cQXvhX"
              >
                <svg
                  fill="none"
                  height="32"
                  viewBox="0 0 150 32"
                  width="150"
                  xmlns="http://www.w3.org/2000/svg"
                >
                  <path
                    clip-rule="evenodd"
                    d="M18.9703 0.305222C19.2104 0.332812 19.4157 0.519049 19.4922 0.739775L19.5131 0.822547L20.2959 4.81975C21.3466 5.22326 22.3382 5.76128 23.2324 6.42345L23.5629 6.67867L27.5153 5.33362C27.7727 5.22326 28.0441 5.30258 28.2354 5.52331C29.5958 7.03734 30.6987 8.86523 31.3424 10.7862C31.4433 11.007 31.3911 11.2656 31.2206 11.4312L31.151 11.4898L28.0128 14.1454C28.1241 14.7386 28.1554 15.3801 28.1554 16.0043C28.1554 16.5078 28.1346 17.0148 28.0684 17.5046L28.0093 17.8667L31.1475 20.5223C31.3702 20.6775 31.4502 20.9741 31.3389 21.2258C30.6987 23.1468 29.5958 24.9747 28.2354 26.4888C28.065 26.6819 27.8284 26.7681 27.5988 26.706L27.5118 26.675L23.5594 25.33C22.6931 26.0232 21.7224 26.5957 20.6891 27.0302L20.2959 27.1854L19.5096 31.1861C19.4609 31.4378 19.2382 31.6689 18.9634 31.7034C17.9405 31.8896 16.9141 32 15.8599 32C14.8057 32 13.7794 31.8896 12.753 31.7034C12.5129 31.6758 12.3077 31.4861 12.2311 31.2689L12.2103 31.1861L11.4274 27.1854C10.3628 26.7785 9.33295 26.2336 8.44923 25.5576L8.16046 25.3265L4.20809 26.6716C3.95063 26.7819 3.67925 26.7026 3.4879 26.4819C2.12753 24.9678 1.02462 23.1399 0.384448 21.2189C0.283551 20.9982 0.335739 20.7361 0.50622 20.574L0.575804 20.5188L3.71056 17.8632C3.59923 17.27 3.56792 16.632 3.56792 16.0043C3.56792 15.5042 3.58879 14.9938 3.6549 14.5075L3.71404 14.1454L0.579283 11.4898C0.356614 11.3311 0.273114 11.038 0.387927 10.7862C1.0281 8.86523 2.13101 7.03734 3.49137 5.52331C3.66185 5.33017 3.89844 5.2474 4.12807 5.30603L4.21505 5.33362L8.16742 6.67867C9.01635 5.9751 10.0218 5.39915 11.0795 4.96115L11.4344 4.81975L12.2172 0.822547C12.2659 0.570782 12.4886 0.336261 12.7634 0.305222C14.8127 -0.101741 16.9246 -0.101741 18.9738 0.305222H18.9703ZM103.125 11.0207C103.915 11.0207 104.646 11.1932 105.321 11.5346C105.992 11.8761 106.573 12.3727 107.06 13.0211C107.547 13.6695 107.93 14.4592 108.208 15.3973C108.487 16.3354 108.626 17.3976 108.626 18.5875C108.626 19.7015 108.466 20.7292 108.149 21.6707C107.833 22.6123 107.387 23.4331 106.817 24.1263C106.246 24.8195 105.564 25.3644 104.767 25.7542C103.974 26.1439 103.094 26.3405 102.127 26.3405C101.337 26.3405 100.672 26.2301 100.137 26.0128C99.6008 25.7955 99.1137 25.4989 98.6753 25.1265V30.8102H94.1419V11.3105H97.0888C97.3115 11.3311 97.5029 11.3932 97.6594 11.4967C97.8508 11.6208 97.983 11.8071 98.063 12.0519L98.4005 13.1383L98.6232 12.9073C98.8493 12.6831 99.0894 12.4727 99.3434 12.2796C99.6808 12.0209 100.039 11.8002 100.425 11.6174C100.812 11.4312 101.226 11.2863 101.667 11.1828C102.113 11.0794 102.596 11.0242 103.122 11.0242L103.125 11.0207ZM60.4737 11.0794C61.4792 11.0794 62.3977 11.2311 63.2292 11.5346C64.0643 11.8381 64.781 12.283 65.3794 12.8624C65.9778 13.4418 66.4475 14.1557 66.785 14.9973C67.1225 15.8388 67.2895 16.7941 67.2895 17.8598C67.2895 18.1943 67.2756 18.4633 67.2442 18.6737C67.2164 18.8841 67.1607 19.0496 67.0842 19.1738C67.0077 19.2979 66.8998 19.3842 66.7711 19.4325C66.6423 19.4807 66.4719 19.5049 66.2666 19.5049H57.5199L57.5512 19.7463C57.7182 20.8603 58.0905 21.6742 58.675 22.195C59.2977 22.7502 60.1049 23.0296 61.0895 23.0296C61.6149 23.0296 62.0707 22.9675 62.4499 22.8433C62.8291 22.7192 63.1701 22.5812 63.4658 22.4295C63.7616 22.2777 64.0364 22.1398 64.2834 22.0156C64.5305 21.8915 64.7914 21.8294 65.0663 21.8294C65.4281 21.8294 65.6995 21.957 65.8839 22.2157L67.199 23.8021L66.9972 24.0194C66.5867 24.4436 66.1518 24.7988 65.6856 25.0782C65.1428 25.4058 64.5896 25.6645 64.019 25.8507C63.4484 26.037 62.8778 26.1646 62.3073 26.237C61.7367 26.3094 61.1939 26.3439 60.6755 26.3439C59.6144 26.3439 58.6158 26.1749 57.6834 25.8369C56.751 25.499 55.9368 24.9954 55.241 24.3298C54.5452 23.6642 53.992 22.8365 53.5884 21.8466C53.1848 20.8568 52.983 19.7049 52.983 18.3909C52.983 17.4011 53.157 16.463 53.5014 15.5767C53.8458 14.6903 54.3434 13.9143 54.994 13.2487C55.6411 12.5831 56.4274 12.0554 57.3494 11.6622C58.2714 11.2725 59.3117 11.0759 60.4737 11.0759V11.0794ZM84.7237 11.0794C85.7292 11.0794 86.6477 11.2311 87.4793 11.5346C88.3143 11.8381 89.031 12.283 89.6294 12.8624C90.2278 13.4418 90.6975 14.1557 91.035 14.9973C91.3725 15.8388 91.5395 16.7941 91.5395 17.8598C91.5395 18.1943 91.5256 18.4633 91.4943 18.6737C91.4664 18.8841 91.4108 19.0496 91.3342 19.1738C91.2577 19.2979 91.1498 19.3842 91.0211 19.4325C90.8889 19.4807 90.7219 19.5049 90.5166 19.5049H81.7699L81.8012 19.7463C81.9682 20.8603 82.3405 21.6742 82.925 22.195C83.5478 22.7502 84.355 23.0296 85.3396 23.0296C85.8649 23.0296 86.3207 22.9675 86.6999 22.8433C87.0792 22.7192 87.4201 22.5812 87.7159 22.4295C88.0116 22.2777 88.2864 22.1398 88.5335 22.0156C88.7805 21.8915 89.0414 21.8294 89.3163 21.8294C89.6781 21.8294 89.9495 21.957 90.1339 22.2157L91.449 23.8021L91.2472 24.0194C90.8367 24.4436 90.4018 24.7988 89.9356 25.0782C89.3928 25.4058 88.8396 25.6645 88.2691 25.8507C87.6985 26.037 87.1279 26.1646 86.5573 26.237C85.9867 26.3094 85.4439 26.3439 84.9255 26.3439C83.8644 26.3439 82.8659 26.1749 81.9334 25.8369C81.001 25.499 80.1869 24.9954 79.491 24.3298C78.7952 23.6642 78.242 22.8365 77.8384 21.8466C77.4348 20.8568 77.233 19.7049 77.233 18.3909C77.233 17.4011 77.407 16.463 77.7514 15.5767C78.0959 14.6903 78.5934 13.9143 79.244 13.2487C79.8911 12.5831 80.6774 12.0554 81.5994 11.6622C82.5214 11.2725 83.5617 11.0759 84.7237 11.0759V11.0794ZM117.807 11.0794C118.959 11.0794 120.006 11.2553 120.953 11.607C121.899 11.9588 122.71 12.4624 123.388 13.1211C124.067 13.7764 124.592 14.5765 124.968 15.5111C125.343 16.4492 125.531 17.5011 125.531 18.6737C125.531 19.8463 125.343 20.9189 124.968 21.8639C124.592 22.8123 124.067 23.6159 123.388 24.2781C122.71 24.9402 121.899 25.4472 120.953 25.8059C120.006 26.1611 118.959 26.3405 117.807 26.3405C116.656 26.3405 115.591 26.1611 114.641 25.8059C113.692 25.4507 112.87 24.9402 112.185 24.2781C111.496 23.6159 110.967 22.8123 110.592 21.8639C110.216 20.9155 110.028 19.8532 110.028 18.6737C110.028 17.4942 110.216 16.4492 110.592 15.5111C110.967 14.573 111.5 13.7764 112.185 13.1211C112.87 12.4658 113.692 11.9588 114.641 11.607C115.591 11.2553 116.649 11.0794 117.807 11.0794ZM145.509 7.00975V...

      90 |     });
      91 |
    > 92 |     expect(screen.getByText(/confirm password/i)).toBeInTheDocument();
         |                   ^
      93 |   });
      94 |
      95 |   it('should have correct welcome prompt flow for reset', async () => {

      at Object.getElementError (node_modules/@testing-library/dom/dist/config.js:37:19)
      at node_modules/@testing-library/dom/dist/query-helpers.js:76:38
      at node_modules/@testing-library/dom/dist/query-helpers.js:52:17
      at node_modules/@testing-library/dom/dist/query-helpers.js:95:19
      at Object.getByText (web/packages/teleport/src/Welcome/Welcome.test.tsx:92:19)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant