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

🚀 Feature: Make "slow" (by default) a function of "timeout" #3600

Closed
boneskull opened this issue Dec 7, 2018 · 2 comments
Closed

🚀 Feature: Make "slow" (by default) a function of "timeout" #3600

boneskull opened this issue Dec 7, 2018 · 2 comments
Labels
semver-major implementation requires increase of "major" version number; "breaking changes" status: wontfix typically a feature which won't be added, or a "bug" which is actually intended behavior type: discussion debates, philosophy, navel-gazing, etc. type: feature enhancement proposal

Comments

@boneskull
Copy link
Member

boneskull commented Dec 7, 2018

I get sick of adjusting slow when adjusting timeout to avoid the warnings.

Unless slow is set by the user, what if we made it a function of the timeout value?

The current default values are 75ms for slow and 200ms for timeout. The function could be, then:

slow = timeout => 0.375 * timeout

(If there's a different function that makes more sense, that'd be cool too)

I propose:

  • If a user provides --slow, that's the value we use.
  • If a user provides --timeout but no --slow, we use the above function to determine the value of slow
  • The equation is computed per-Runnable. Meaning if we see a this.timeout(2000) (but importantly, no this.slow(x)) in a Runnable, then we adjust the slow value using the function.
  • If the user provides this.slow(x) in a Runnable, we use that value, otherwise we revert to whatever's used in the parent context. If it's set explicitly via this.slow(x) in some parent context, use that; if it's set via --slow do the same. If it's not set anywhere, use the function.

An alternative:

  • If slow is less than 1, it's no longer in milliseconds; it's considered a percentage of the value of timeout. We could get away with shipping that in a minor

Thoughts? @mochajs/core

@boneskull boneskull added type: feature enhancement proposal semver-major implementation requires increase of "major" version number; "breaking changes" type: discussion debates, philosophy, navel-gazing, etc. labels Dec 7, 2018
@boneskull
Copy link
Member Author

boneskull commented Dec 7, 2018

I kind of hate calling it semver-major but there's probably something that consumes it and expects it to be a certain thing and will break when it isn't. 🤷‍♂️

@JoshuaKGoldberg
Copy link
Member

This is a nifty idea but it's only had one user interaction per two years on average since it was posted. Per #5027 we're trying to avoid big shakeups.

Someone please yell at me if this actually should be discussed more deeply. Cheers!

@JoshuaKGoldberg JoshuaKGoldberg closed this as not planned Won't fix, can't repro, duplicate, stale Dec 27, 2023
@JoshuaKGoldberg JoshuaKGoldberg changed the title feature: make "slow" (by default) a function of "timeout" 🚀 Feature: Make "slow" (by default) a function of "timeout" Dec 27, 2023
@JoshuaKGoldberg JoshuaKGoldberg added the status: wontfix typically a feature which won't be added, or a "bug" which is actually intended behavior label Dec 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver-major implementation requires increase of "major" version number; "breaking changes" status: wontfix typically a feature which won't be added, or a "bug" which is actually intended behavior type: discussion debates, philosophy, navel-gazing, etc. type: feature enhancement proposal
Projects
None yet
Development

No branches or pull requests

2 participants