Skip to content

test/apps/basics is non-deterministic #404

Description

@GrygrFlzr

Describe the bug
I've encountered this twice now modifying unrelated files on two different branches.

Logs

CI logs
> test-basics@0.0.2 test /home/runner/work/kit/kit/test/apps/basics
> node test

dev
 dev  [snowpack] ! building dependencies...
[snowpack] ✔ dependencies ready! [1.09s]
  http://localhost:3001 • http://10.1.0.4:3001
  Server started.


• ✘ • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • •   (101 / 102)

   FAIL  dev  "announces client-side navigation [js]"
    Expected values to be deeply equal:  (equal)

        ++Navigated·to·b    (Expected)
        --                  (Actual)
          ^^^^^^^^^^^^^^
    at assert (file:///home/runner/work/kit/kit/node_modules/.pnpm/uvu@0.6.0-next.1/node_modules/uvu/assert/index.mjs:31:8)
    at Module.equal (file:///home/runner/work/kit/kit/node_modules/.pnpm/uvu@0.6.0-next.1/node_modules/uvu/assert/index.mjs:43:2)
    at file:///home/runner/work/kit/kit/test/apps/basics/src/routes/accessibility/__tests__.js:41:11
    at async Object.handler (file:///home/runner/work/kit/kit/test/runner.js:113:7)
    at async Number.runner (file:///home/runner/work/kit/kit/node_modules/.pnpm/uvu@0.6.0-next.1/node_modules/uvu/dist/index.mjs:78:5)
    at async Module.exec (file:///home/runner/work/kit/kit/node_modules/.pnpm/uvu@0.6.0-next.1/node_modules/uvu/dist/index.mjs:132:33)
    at async runner (file:///home/runner/work/kit/kit/test/runner.js:180:2)

To Reproduce
Unknown. It's some sort of race condition in the basics test.

Expected behavior
Deterministic behavior.

Additional context
First encountered in #402, then in #403. It's most likely related to the fact that the test involves an await sleep(50):

await click('[href="/accessibility/b"]');
await sleep(50);
assert.equal(await html('[aria-live]'), 'Navigated to b'); // TODO i18n

Strongly related to #213.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions