Skip to content

Commit

Permalink
Decrease default scope_stress test size, add env var config (#8546)
Browse files Browse the repository at this point in the history
### Description

I've noticed this test often times out on CI (after >10 minutes!),
possibly because it runs out of ram and starts swapping.

This decreases the size significantly (this is `O(n^2)`). Locally the
test now runs in about 1-2 seconds on my local machine (versus >30
seconds).

### Testing Instructions

```
cargo test -p turbo-tasks-memory rectangle_stress
```

```
TURBOPACK_TEST_RECTANGLE_STRESS_SIZE=100 cargo test -p turbo-tasks-memory rectangle_stress
```
  • Loading branch information
bgw committed Jun 20, 2024
1 parent 3208478 commit 3bca6e8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion crates/turbo-tasks-memory/tests/scope_stress.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ fn rectangle_stress() {
.unwrap();
rt.block_on(async {
let tt = TurboTasks::new(MemoryBackend::default());
let size = 100;
let size = std::env::var("TURBOPACK_TEST_RECTANGLE_STRESS_SIZE")
.map(|size| size.parse().unwrap())
.unwrap_or(50);
(0..size)
.map(|a| (a, size - 1))
.chain((0..size - 1).map(|b| (size - 1, b)))
Expand Down

0 comments on commit 3bca6e8

Please sign in to comment.