-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-ioArea: `std::io`, `std::fs`, `std::net` and `std::path`Area: `std::io`, `std::fs`, `std::net` and `std::path`A-testsuiteArea: The testsuite used to check the correctness of rustcArea: The testsuite used to check the correctness of rustcC-cleanupCategory: PRs that clean code up or issues documenting cleanup.Category: PRs that clean code up or issues documenting cleanup.T-libsRelevant to the library team, which will review and decide on the PR/issue.Relevant to the library team, which will review and decide on the PR/issue.
Description
I was running ./x test library/std --stage 0
locally, and a bunch of std TCP tests were failing because apparently my VPN software is already using one of the ports that the TCP tests were trying to use (this part is user issue).
However, while reading the tests it seems like base_port
(which I think is transitively used by TCP tests) is doing some kind of... CI job detection? Which has been outdated for many years? Not sure what this is supposed to be.
rust/library/std/src/net/test.rs
Lines 34 to 60 in 5958825
// The bots run multiple builds at the same time, and these builds | |
// all want to use ports. This function figures out which workspace | |
// it is running in and assigns a port range based on it. | |
fn base_port() -> u16 { | |
let cwd = if cfg!(target_env = "sgx") { | |
String::from("sgx") | |
} else { | |
env::current_dir().unwrap().into_os_string().into_string().unwrap() | |
}; | |
let dirs = [ | |
"32-opt", | |
"32-nopt", | |
"musl-64-opt", | |
"cross-opt", | |
"64-opt", | |
"64-nopt", | |
"64-opt-vg", | |
"64-debug-opt", | |
"all-opt", | |
"snap3", | |
"dist", | |
"sgx", | |
]; | |
dirs.iter().enumerate().find(|&(_, dir)| cwd.contains(dir)).map(|p| p.0).unwrap_or(0) as u16 | |
* 1000 | |
+ 19600 | |
} |
Metadata
Metadata
Assignees
Labels
A-ioArea: `std::io`, `std::fs`, `std::net` and `std::path`Area: `std::io`, `std::fs`, `std::net` and `std::path`A-testsuiteArea: The testsuite used to check the correctness of rustcArea: The testsuite used to check the correctness of rustcC-cleanupCategory: PRs that clean code up or issues documenting cleanup.Category: PRs that clean code up or issues documenting cleanup.T-libsRelevant to the library team, which will review and decide on the PR/issue.Relevant to the library team, which will review and decide on the PR/issue.