Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
N
next.js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alex
next.js
Commits
47b0387d
Unverified
Commit
47b0387d
authored
Apr 16, 2025
by
Tobias Koppers
Committed by
GitHub
Apr 16, 2025
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Turbopack: Do multiple unit test runs (#78212)
### What? This allows to test caching more aggressively
parent
3dc939b7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
14 deletions
+18
-14
run.rs
turbopack/crates/turbo-tasks-testing/src/run.rs
+18
-14
No files found.
turbopack/crates/turbo-tasks-testing/src/run.rs
View file @
47b0387d
...
@@ -109,22 +109,26 @@ where
...
@@ -109,22 +109,26 @@ where
let
start
=
std
::
time
::
Instant
::
now
();
let
start
=
std
::
time
::
Instant
::
now
();
let
first
=
fut
(
tt
.clone
())
.await
?
;
let
first
=
fut
(
tt
.clone
())
.await
?
;
println!
(
"Run #1 took {:?}"
,
start
.elapsed
());
println!
(
"Run #1 took {:?}"
,
start
.elapsed
());
println!
(
"Run #2 (with memory cache, same TurboTasks instance)"
);
for
i
in
2
..
10
{
let
start
=
std
::
time
::
Instant
::
now
();
println!
(
"Run #{i} (with memory cache, same TurboTasks instance)"
);
let
second
=
fut
(
tt
.clone
())
.await
?
;
let
start
=
std
::
time
::
Instant
::
now
();
println!
(
"Run #2 took {:?}"
,
start
.elapsed
());
let
second
=
fut
(
tt
.clone
())
.await
?
;
assert_eq!
(
first
,
second
);
println!
(
"Run #{i} took {:?}"
,
start
.elapsed
());
let
start
=
std
::
time
::
Instant
::
now
();
assert_eq!
(
first
,
second
);
tt
.stop_and_wait
()
.await
;
}
println!
(
"Stopping TurboTasks took {:?}"
,
start
.elapsed
());
let
tt
=
registration
.create_turbo_tasks
(
&
name
,
false
);
println!
(
"Run #3 (with persistent cache if available, new TurboTasks instance)"
);
let
start
=
std
::
time
::
Instant
::
now
();
let
third
=
fut
(
tt
.clone
())
.await
?
;
println!
(
"Run #3 took {:?}"
,
start
.elapsed
());
let
start
=
std
::
time
::
Instant
::
now
();
let
start
=
std
::
time
::
Instant
::
now
();
tt
.stop_and_wait
()
.await
;
tt
.stop_and_wait
()
.await
;
println!
(
"Stopping TurboTasks took {:?}"
,
start
.elapsed
());
println!
(
"Stopping TurboTasks took {:?}"
,
start
.elapsed
());
assert_eq!
(
first
,
third
);
for
i
in
10
..
20
{
let
tt
=
registration
.create_turbo_tasks
(
&
name
,
false
);
println!
(
"Run #{i} (with persistent cache if available, new TurboTasks instance)"
);
let
start
=
std
::
time
::
Instant
::
now
();
let
third
=
fut
(
tt
.clone
())
.await
?
;
println!
(
"Run #{i} took {:?}"
,
start
.elapsed
());
let
start
=
std
::
time
::
Instant
::
now
();
tt
.stop_and_wait
()
.await
;
println!
(
"Stopping TurboTasks took {:?}"
,
start
.elapsed
());
assert_eq!
(
first
,
third
);
}
Ok
(())
Ok
(())
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment