Skip to content

Failing test in tests/native/quiche.test.ts #152

@aryanjassal

Description

@aryanjassal

Describe the bug

In tests/native/quiche.test.ts, the test for packet parsing failed. The test expected BufferTooShort but it received InvalidPacket as an error. There is a comment made on the test that InvalidPacket errors are rare and should be saved if encountered.

To Reproduce

  1. Add { seed: -718106330, path: "36:6:5:3:3:3:8:12:16:15:15:15:15:15:15:15:27:22:23:11:2:4:5:2:2:17:16:15", endOnFailure: true } to the packet parsing test in tests/native/quiche.test.ts under test.prop
  2. Run test
  3. Observe failure

Expected behavior

The test should pass

Logs

 FAIL  tests/native/quiche.test.ts
  native/quiche
    ✕ packet parsing (with seed=-718106330) (19 ms)
    ✓ version negotiation (1 ms)
  ● native/quiche › packet parsing (with seed=-718106330)
    Property failed after 1 tests
    { seed: -718106330, path: "36:6:5:3:3:3:8:12:16:15:15:15:15:15:15:15:27:22:23:11:2:4:5:2:2:17:16:15", endOnFailure: true }
    Counterexample: [Buffer.from([128,0,0,0,1,21])]
    Shrunk 0 time(s)
    Hint: Enable verbose mode in order to have the list of all failing values encountered during the run
      at buildError (node_modules/fast-check/lib/check/runner/utils/RunDetailsFormatter.js:156:19)
      at asyncThrowIfFailed (node_modules/fast-check/lib/check/runner/utils/RunDetailsFormatter.js:170:11)
    Cause:
    expect(received).toBe(expected) // Object.is equality
    Expected: "BufferTooShort"
    Received: "InvalidPacket"
      30 |         quiche.Header.fromSlice(packet, quiche.MAX_CONN_ID_LEN);
      31 |       } catch (e) {
    > 32 |         expect(e.message).toBe('BufferTooShort');
         |                           ^
      33 |         // InvalidPacket seems very rare, save it as an example if you find one!
      34 |       }
      35 |     },
      at toBe (tests/native/quiche.test.ts:32:27)
      at node_modules/@fast-check/jest/lib/internals/TestWithPropRunnerBuilder.js:3:41
      at AsyncProperty.predicate (node_modules/fast-check/lib/check/property/AsyncProperty.js:14:59)
      at AsyncProperty.run (node_modules/fast-check/lib/check/property/AsyncProperty.generic.js:43:39)
      at SkipAfterProperty.run (node_modules/fast-check/lib/check/property/SkipAfterProperty.js:46:57)
      at asyncRunIt (node_modules/fast-check/lib/check/runner/Runner.js:24:36)
      at Object.<anonymous> (node_modules/@fast-check/jest/lib/internals/TestWithPropRunnerBuilder.js:40:9)

Platform

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS]
  • Version: [e.g. 22]

Additional context

Counterexample: [Buffer.from([128,0,0,0,1,21])]
Observed via: https://github.com/MatrixAI/js-quic/actions/runs/15060483280/job/42598884435

Notify maintainers

@CMCDragonkai @tegefaulkes

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions