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

chore: enable anchoring on recon mode #3185

Conversation

JulissaDantes
Copy link
Contributor

Description

  • Unskip all skipped anchoring tests in js-ceramic
  • Re-enable the anchoring code paths disabled with recon mode

Copy link

linear bot commented Mar 15, 2024

@JulissaDantes JulissaDantes marked this pull request as draft March 15, 2024 12:11
Copy link
Contributor

@nathanielc nathanielc left a comment

Choose a reason for hiding this comment

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

LGTM!

@stbrody
Copy link
Contributor

stbrody commented Mar 18, 2024

I'm going to hold off on reviewing this until CI is green, looks like there are still some remaining issues right now

@@ -152,7 +152,7 @@ test('Dont process the same entry multiple times concurrently', async () => {
async function* overEntries(): AsyncGenerator<number> {
do {
// Need this sleep or else the Node runtime might never switch back to the "process" function.
await CommonTestUtils.delay(1)
await CommonTestUtils.delay(5)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@ukstv This is how I solved it

Copy link
Contributor

Choose a reason for hiding this comment

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

what's the issue you were seeing? This change really shouldn't be necessary. This sleep isn't actually making the test wait for anything to happen, it's just so that the Node event loop has an interrupt point so other jobs can get scheduled, otherwise the generator can just emit events forever without the task to process those events ever running. But increasing the duration of the sleep should have no affect on the rest of the system or the test, unless I really misunderstood something when I wrote this test.

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm assuming this test failure was the issue: https://app.circleci.com/pipelines/github/ceramicnetwork/js-ceramic/13094/workflows/f7e8914c-f718-40e3-bfd6-4ee07174026c/jobs/18766

Put together a PR that I believe should fix the race condition in the test: #3192

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes that was the issue, thanks for the PR

Copy link
Contributor

Choose a reason for hiding this comment

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

Can this change be reverted now that #3192 is in?

Copy link
Contributor

Choose a reason for hiding this comment

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

ping

@JulissaDantes JulissaDantes force-pushed the feature/ws2-3129-enable-anchoring-as-part-of-the-ceramic_recon_mode branch from 1c66918 to f8fa7e9 Compare March 28, 2024 13:14
@JulissaDantes JulissaDantes marked this pull request as ready for review March 28, 2024 19:49
@JulissaDantes
Copy link
Contributor Author

I did not have to make changes to the code other than enabling the anchor when using recon, but I did have to adjust the test setup. A common modification was to add some delay, which is why you will see it in some tests. Ready to be reviewed by @stbrody and @nathanielc.

Copy link
Contributor

@stbrody stbrody left a comment

Choose a reason for hiding this comment

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

looking good, a few small comments to clean things up a bit

@@ -152,7 +152,7 @@ test('Dont process the same entry multiple times concurrently', async () => {
async function* overEntries(): AsyncGenerator<number> {
do {
// Need this sleep or else the Node runtime might never switch back to the "process" function.
await CommonTestUtils.delay(1)
await CommonTestUtils.delay(5)
Copy link
Contributor

Choose a reason for hiding this comment

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

Can this change be reverted now that #3192 is in?

packages/stream-tests/src/__tests__/model.test.ts Outdated Show resolved Hide resolved
@JulissaDantes JulissaDantes requested a review from stbrody March 29, 2024 23:19
Copy link
Contributor

@stbrody stbrody left a comment

Choose a reason for hiding this comment

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

lgtm mod undoing the change to increase the delay in anchor-processing-loop.test.ts

@@ -152,7 +152,7 @@ test('Dont process the same entry multiple times concurrently', async () => {
async function* overEntries(): AsyncGenerator<number> {
do {
// Need this sleep or else the Node runtime might never switch back to the "process" function.
await CommonTestUtils.delay(1)
await CommonTestUtils.delay(5)
Copy link
Contributor

Choose a reason for hiding this comment

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

ping

@JulissaDantes JulissaDantes enabled auto-merge (squash) April 1, 2024 19:26
@JulissaDantes JulissaDantes merged commit 161f31f into develop Apr 1, 2024
7 checks passed
@JulissaDantes JulissaDantes deleted the feature/ws2-3129-enable-anchoring-as-part-of-the-ceramic_recon_mode branch April 1, 2024 19:56
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.

3 participants