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

Intermittent test failure #350

Open
curtis-h opened this issue Dec 13, 2024 · 0 comments
Open

Intermittent test failure #350

curtis-h opened this issue Dec 13, 2024 · 0 comments

Comments

@curtis-h
Copy link
Contributor

curtis-h commented Dec 13, 2024

Is this a regression?

Yes

Description

CI has highlighted an intermittently occurring bug.

Examples:
https://github.com/hyperledger/identus-edge-agent-sdk-ts/actions/runs/12300926616/job/34330763881#step:9:841
https://github.com/hyperledger/identus-edge-agent-sdk-ts/actions/runs/12315609102/job/34374173505#step:9:841

Current guesses are it's the seed being generated causing an invalid key,
or we just generate an invalid key,
or we create a bad did from a key
I've managed to reproduce with the following code



import { describe, it } from 'vitest';
import { Curve, KeyTypes } from "../../src/domain";

import Castor from "../../src/castor/Castor";
import Apollo from "../../src/apollo/Apollo";

describe("unknown bug", () => {
  // 500 seems to be the sweet spot for bug occurrence
  for (let loop = 0; loop < 500; loop++) {
    it("minimal repro", async () => {
      const apollo = new Apollo();
      const castor = new Castor(apollo);
      const seed = apollo.createRandomSeed().seed;
      const key = apollo.createPrivateKey({
        type: KeyTypes.EC,
        curve: Curve.SECP256K1,
        seed: Buffer.from(seed.value).toString("hex"),
      });

      const did = await castor.createPrismDID(key.publicKey());

      await castor.resolveDID(did.toString());
    });
  }
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant