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

Rewrite tests to reduce running time #16838

Merged
merged 1 commit into from May 15, 2019
Merged

Rewrite tests to reduce running time #16838

merged 1 commit into from May 15, 2019

Conversation

rwlbuis
Copy link
Contributor

@rwlbuis rwlbuis commented May 15, 2019

No description provided.

Copy link
Contributor

@yoavweiss yoavweiss left a comment

Choose a reason for hiding this comment

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

Thanks for making the tests faster!! :)

@@ -16,6 +16,11 @@ function verifyNumberOfResourceTimingEntries(url, number)
assert_equals(numEntries, number, url);
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: You could use the helper function here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will do.

}
iterations++;
if (iterations == 10) {
verifyNumberOfResourceTimingEntries("resources/square.png?link-header-preload", 1);
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do you need to verify here if you already checked for the values earlier? I don't think these asserts will ever pass. Or are you expecting them to fail? If so, maybe make that failure more explicit? (e.g. assert_unreached)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I wanted to make this test behave similarly to the current version and give feedback which asserts are failing. If you think it is ok to instead have a generic unreached message, I am fine with that as well?

Copy link
Contributor

Choose a reason for hiding this comment

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

That's fair. Maybe then add a comment that you expect them to fail? Also, I forget but do we need a done() in case of failed expectations?

Copy link
Contributor

@yoavweiss yoavweiss left a comment

Choose a reason for hiding this comment

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

LGTM % discussed nits

@rwlbuis rwlbuis merged commit 7f72c4e into master May 15, 2019
@rwlbuis rwlbuis deleted the preload branch May 15, 2019 09:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants