Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

hi-ogawa
Copy link
Contributor

@hi-ogawa hi-ogawa commented Jan 5, 2024

Description

There were two more const DURATION_LONG = 300 hard-coded in list/table renders. This PR does the same for these two as done in #2396.

I didn't attempt to add a test yet since list renderer requires non CI environment, so I suspect it might be too difficult and also overkill to setup this scenario.

The fix can be verified locally using existing core test, which coincidentally takes 400ms and has slowTestThreshold: 1000:

  • before (400ms > hard-coded 300ms)
$ pnpm -C test/core test run test-extend.test.ts 
...

 ✓ |core| test/test-extend.test.ts (18) 411ms

...

   ✓ asynchonous setup/teardown (1) 401ms
     ✓ quick test 401ms
  • after (400ms < slowTestThreshold 1000ms)
$ pnpm -C test/core test run test-extend.test.ts 
...

 ✓ |core| test/test-extend.test.ts (18)

...

   ✓ asynchonous setup/teardown (1)
     ✓ quick test

Please don't delete this checklist! Before submitting the PR, please make sure you do the following:

  • It's really useful if your PR references an issue where it is discussed ahead of time. If the feature is substantial or introduces breaking changes without a discussion, PR might be closed.
  • Ideally, include a test that fails without this PR but passes with it.
  • Please, don't make changes to pnpm-lock.yaml unless you introduce a new test example.

Tests

  • Run the tests with pnpm test:ci.

Documentation

  • If you introduce new functionality, document it. You can run documentation with pnpm run docs command.

Changesets

  • Changes in changelog are generated from PR name. Please, make sure that it explains your changes in an understandable manner. Please, prefix changeset messages with feat:, fix:, perf:, docs:, or chore:.

Copy link

netlify bot commented Jan 5, 2024

Deploy Preview for fastidious-cascaron-4ded94 canceled.

Name Link
🔨 Latest commit 0b58984
🔍 Latest deploy log https://app.netlify.com/sites/fastidious-cascaron-4ded94/deploys/6597599de181c60008793844

if (this.isTTY) {
this.rendererOptions.logger = this.ctx.logger
this.rendererOptions.showHeap = this.ctx.config.logHeapUsage
this.rendererOptions.slowTestThreshold = this.ctx.config.slowTestThreshold
Copy link
Contributor Author

@hi-ogawa hi-ogawa Jan 5, 2024

Choose a reason for hiding this comment

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

For this one, it might be better to have a separate option under benchmark.slowThreshold (or maybe just adjusting some documentation is enough https://vitest.dev/config/#slowtestthreshold)

@hi-ogawa hi-ogawa marked this pull request as ready for review January 5, 2024 01:48
@sheremet-va sheremet-va merged commit 1769c79 into vitest-dev:main Jan 5, 2024
@hi-ogawa hi-ogawa deleted the fix-slowTestThreshold branch January 5, 2024 08:29
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.

slowTestThreshold doesn't seem to be working
2 participants