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

fix dedup logs #977

Merged
merged 2 commits into from
May 1, 2023
Merged

fix dedup logs #977

merged 2 commits into from
May 1, 2023

Conversation

pepoviola
Copy link
Collaborator

Fixes #580

And our current CI.

Copy link
Contributor

@l0r1s l0r1s left a comment

Choose a reason for hiding this comment

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

Some questions about the variable initialization

Comment on lines +428 to +429
lastLogLineCheckedTimestamp,
lastLogLineCheckedIndex,
Copy link
Contributor

Choose a reason for hiding this comment

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

It won't cause issue if it's not initialized ?

lastLogLineCheckedIndex: number,
): string[] {
if (!lastLogLineCheckedTimestamp) return logs;
if (useIndex) return logs.slice(lastLogLineCheckedIndex);
Copy link
Contributor

Choose a reason for hiding this comment

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

Here, lastLogLineCheckedIndex is undefined when entering the above loop

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Well, those two variables work in tandem to represent the different providers features. The invariant here is that lastLogLineCheckedIndex will be undefined at the same time that lastLogLineCheckedTimestamp is undefinded, so the this if (https://github.com/paritytech/zombienet/pull/977/files#diff-fc4624d6bb61da0712b154b5018f73681adaf8edadb4236a0b5293ea915ef41eR549) cover this case.

I think there is room to improving here, but we can do it in a follow up pr.

Thanks!

@pepoviola pepoviola merged commit 1236136 into main May 1, 2023
@pepoviola pepoviola deleted the fix-dedup-logs branch May 1, 2023 11:52
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.

Multiple line matches in test do not work
3 participants