Skip to content

A new thread is created for each test even if --test-threads=1 #104053

Open
@Taaitaaiger

Description

@Taaitaaiger

With nightly Rust, tests are run on separate threads even if --test-threads=1. It seems that a new thread is created for each test now, while they were previously run on the main thread if --test-threads=1. This breaks testing for jlrs, which depends on all tests running on the same thread. The underlying reason for this is that Julia can only be initialized once during a process's lifetime, and access is limited to the thread that initialized it.

My expectation is that --test-threads runs all tests on the same thread, or that I set use some other flag to achieve this.

Rust version: 1286ee2 2022-11-05

Metadata

Metadata

Assignees

Labels

A-libtestArea: `#[test]` / the `test` libraryC-bugCategory: This is a bug.T-testing-devexRelevant to the testing devex team (testing DX), which will review and decide on the PR/issue.

Type

No type

Projects

Status

No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions