Unverified Commit 6ebc729c authored by Tobias Koppers's avatar Tobias Koppers Committed by GitHub

Turbopack: fix turbo-trace-size test after MemorySample gained active_worker_threads (#99824)

### What?

Fixes the `rust check` (clippy) and `test cargo unit` jobs on canary,
which fail with:

```
error[E0063]: missing field `active_worker_threads` in initializer of `TraceRow<'_>`
   --> turbopack/crates/turbopack-trace-size/src/lib.rs:936:13
```

The fix adds the missing field to the `TraceRow::MemorySample` row in
the `turbo-trace-size` unit test.

### Why?

This was a semantic merge conflict between two PRs that each passed CI
on their own:

- #99233 added `active_worker_threads` to `TraceRow::MemorySample`.
- #99765 added the `turbo-trace-size` crate, whose test builds a
`MemorySample` row without that field.

Only test code is affected. Every other `MemorySample` constructor
already sets the field.

### How?

The test row now sets `active_worker_threads: 3`. The size assertions
are computed from the serialized rows, so they don't change.

Verified locally on top of `db03f83f`: before the change, `cargo test -p
turbopack-trace-size` fails with the error above. After it, the
following pass:

- `cargo test -p turbopack-trace-size`
- `cargo clippy --all-targets -- -D warnings` for
`turbopack-trace-size`, `turbopack-trace-utils` and
`turbopack-trace-server`
- tests of `turbopack-trace-utils` and `turbopack-trace-server`

<!-- NEXT_JS_LLM -->


<!-- fleet 4a52842b-f1a2-43cb-9779-3655caada6a0 -->
Co-authored-by: 's avatarvercel-fleet-prod[bot] <318278635+vercel-fleet-prod[bot]@users.noreply.github.com>
Co-authored-by: 's avatarTobias Koppers <1365881+sokra@users.noreply.github.com>
parent db03f83f
...@@ -937,6 +937,7 @@ mod tests { ...@@ -937,6 +937,7 @@ mod tests {
ts: 1000, ts: 1000,
memory: 1 << 30, memory: 1 << 30,
memory_pressure: 200, memory_pressure: 200,
active_worker_threads: 3,
}, },
// Rows of other threads can be written before the `Start` of their span // Rows of other threads can be written before the `Start` of their span
TraceRow::Exit { TraceRow::Exit {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment