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

add in replicated execution #2513

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

add in replicated execution #2513

wants to merge 4 commits into from

Conversation

bdemann
Copy link
Member

@bdemann bdemann commented Jan 14, 2025

Finishing touches

  • composite query
  • call query from update
  • call composite query from update
    • can't call composite query from update
  • Break out into more jest steps
  • timer
  • heartbeat
  • call stuff a few time to make it feel more property-ish
  • inspect message looks sus

Contributor

  • Breaking changes enumerated in the release issue
  • New documentation enumerated in the release issue
  • Code has been declaratized
  • Error handling beautiful (no unwraps or expects etc)
  • Code tested thoroughly
  • All new functions have JSDoc/Rustdoc comments
  • Related issues have been linked and all tasks have been completed or made into separate issues

Reviewer

  • Breaking changes enumerated in the release issue
  • New documentation enumerated in the release issue
  • Code has been declaratized
  • Error handling beautiful (no unwraps or expects etc)
  • Code tested thoroughly
  • All new functions have JSDoc/Rustdoc comments
  • Related issues have been linked and all tasks have been completed or made into separate issues

@bdemann bdemann linked an issue Jan 15, 2025 that may be closed by this pull request
10 tasks
@bdemann bdemann removed a link to an issue Jan 16, 2025
10 tasks
@bdemann bdemann linked an issue Jan 16, 2025 that may be closed by this pull request
@bdemann bdemann marked this pull request as ready for review January 16, 2025 21:15
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we stopping and deleting the canister here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we should be implementing anything on the ic object anymore, let's remove this and all experimental ic object code

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's delete this

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's not implement this in the experimental ic object

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

}
}

@inspectMessage
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rearchitect the inspectMessage

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make sure falling through won't give us false positives

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

inspectMessage does not run in replicated mode

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

7 ways to Sunday this test should not have false positives

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you not think we should have this run multiple times at least like the other property tests?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As in, instead of the for loops, we actually use fast check...deploying might harm this idea?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we really wanted that we could make sure that it would still work with deploying.

However, the point of using fast check to do num runs is 1. to make sure we have different values each run, and 2 to be able to make sure that those values are different than the previous runs. Since we don't need that and we don't need to change how many runs we do arbitrarily, I feel like we can just pick a number we fill good with and just do that every time. If I'm being honest I feel like the for loop is a little excessive. I don't want to use fast check just to make it feel more like a prop test. It is a prop test. The property we are testing is that every time inReplicatedExecution is called in X environment it returns Y. Where X is a very specific enumerable environment and Y is a very specific deterministic one to one result. It is a prop test, it just doesn't need arbitrariness to prove it, says I.

for (let i = 0; i < 10; i++) {
expect(
await actor.getInspectMessageIsInReplicatedExecution()
).toBe(true);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should never be true

).toStrictEqual([true]);
});

it('redeploys the canister', async () => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be a please right?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done


expect(
await actor.getHeartbeatIsInReplicatedExecution()
).toStrictEqual([true]);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does this use toStrictEqual([true]) when other areas in this file do not? I think we should unify

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure

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

Successfully merging this pull request may close these issues.

inReplicatedExecution (ic api)
2 participants