Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ignore] testing CI #22

Closed
wants to merge 38 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
c7a8758
ci: test-run benchmarks
mxinden Oct 20, 2024
a5e3b6f
refactor(udp/bench): add fn new_socket
mxinden Oct 20, 2024
a5046ad
refactor(udp/bench): switch to async
mxinden Oct 20, 2024
b5902da
fix(udp/bench): enforce max 64k UDP datagram limit
mxinden Oct 23, 2024
91a639f
feat(udp/bench): support recvmmsg
mxinden Oct 20, 2024
adc4a06
feat: Faster UDP/IO on Apple platforms
larseggert Oct 14, 2024
5dd3497
chore: `cargo +nightly clippy --fix`
larseggert Oct 9, 2024
b8e29f5
Move logging of non-WouldBlock errors for unix
thomaseizinger Oct 21, 2024
f06738b
Extract `send` free function for Windows implementation
thomaseizinger Oct 21, 2024
d442b50
Extract `send` free function for fallback implementation
thomaseizinger Oct 21, 2024
62ba079
Introduce `UdpSocketState::try_send` API for unix
thomaseizinger Oct 21, 2024
e055980
Introduce `UdpSocketState::try_send` API for windows
thomaseizinger Oct 21, 2024
bb68125
Introduce `UdpSocketState::try_send` API for fallback
thomaseizinger Oct 21, 2024
a5d9bd1
crypto: expose negotiated_cipher_suite in the hadshake data
BiagioFesta Oct 4, 2024
a461695
feat(quinn-udp): support both windows-sys v0.52 and v0.59
mxinden Oct 28, 2024
e7ae563
chore(quinn-udp): increase crate patch version to v0.5.6
mxinden Oct 28, 2024
c3e70aa
build(deps): update rustls-platform-verifier requirement from 0.3 to 0.4
dependabot[bot] Nov 4, 2024
44651ca
Adopt Option::insert
Ralith Nov 4, 2024
2006eca
const VarInt::size
Ralith Nov 4, 2024
d4e7691
Format
Ralith Nov 4, 2024
690f0d9
Account for worst-case header + tag size when deciding to coalesce
Ralith Nov 4, 2024
8e4e762
Fix some packet/datagram confusion in comments
Ralith Nov 4, 2024
13a9e5e
Fix debug_assert when coalescing large packets
Ralith Nov 4, 2024
722835b
Unbreak Solaris build after #1993
psumbera Nov 5, 2024
a0bcb35
quinn-udp: increase crate patch version to v0.5.7
psumbera Nov 5, 2024
4974621
feat(quinn-proto): Allow notifying of network path changes
flub Oct 31, 2024
a0d8985
feat(quinn-proto): Support & test `wasm32-unknown-unknown` target
matheus23 Nov 6, 2024
9be256e
feat: enable rustls logging, gated by rustls-log feature flag
crazyscot Nov 9, 2024
18b7956
build(deps): update thiserror requirement from 1.0.21 to 2.0.3
dependabot[bot] Nov 11, 2024
8c66491
proto: Rename frame::Type to FrameType
gretchenfrage Nov 9, 2024
7944e0f
proto: Fix missing re-exports
gretchenfrage Nov 9, 2024
eebccff
quinn: Fix missing re-exports
gretchenfrage Nov 9, 2024
2a8b904
proto: bump version to 0.11.9
djc Nov 11, 2024
ca1f2ef
Revert "crypto: expose negotiated_cipher_suite in the hadshake data"
djc Nov 11, 2024
66546dd
quinn: bump version to 0.11.6
djc Nov 11, 2024
bb4df4d
fixes https://github.com/quinn-rs/quinn/issues/2033
delta4chat Nov 12, 2024
d23e4e4
CI: add test for netbsd
delta4chat Nov 12, 2024
5d4a735
chore(ci): Remove workaround for broken `cc` version
matheus23 Nov 11, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[target.wasm32-unknown-unknown]
runner = "wasm-bindgen-test-runner"
77 changes: 73 additions & 4 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,40 @@ jobs:
pkg install -y curl
curl https://sh.rustup.rs -sSf --output rustup.sh
sh rustup.sh -y --profile minimal --default-toolchain stable
echo "~~~~ rustc --version ~~~~"
$HOME/.cargo/bin/rustc --version
echo "~~~~ freebsd-version ~~~~"
run: |
export PATH="$HOME/.cargo/bin:$PATH"
echo "===== rustc --version ====="
rustc --version
echo "===== freebsd-version ====="
freebsd-version
run: $HOME/.cargo/bin/cargo build --all-targets && $HOME/.cargo/bin/cargo test && $HOME/.cargo/bin/cargo test --manifest-path fuzz/Cargo.toml

cargo build --all-targets && cargo test && cargo test --manifest-path fuzz/Cargo.toml && cargo test -p quinn-udp --benches

test-netbsd:
name: test on netbsd
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: test on netbsd
uses: vmactions/netbsd-vm@v1
with:
usesh: true
mem: 4096
copyback: false
prepare: |
export PATH="/usr/sbin:/sbin:$PATH"
pkg_add curl
curl https://sh.rustup.rs -sSf --output rustup.sh
sh rustup.sh -y --profile minimal --default-toolchain stable
run: |
export PATH="$HOME/.cargo/bin:$PATH"
echo "===== rustc --version ====="
rustc --version
echo "===== uname -a ====="
uname -a

cargo build --all-targets && cargo test && cargo test --manifest-path fuzz/Cargo.toml && cargo test -p quinn-udp --benches

test:
strategy:
matrix:
Expand All @@ -54,6 +83,7 @@ jobs:
- run: cargo test
- run: cargo test --manifest-path fuzz/Cargo.toml
if: ${{ matrix.rust }} == "stable"
- run: cargo test -p quinn-udp --benches

test-aws-lc-rs:
runs-on: ubuntu-latest
Expand All @@ -68,6 +98,45 @@ jobs:
- run: RUST_BACKTRACE=1 cargo test --manifest-path quinn-proto/Cargo.toml --no-default-features --features rustls-aws-lc-rs-fips
- run: RUST_BACKTRACE=1 cargo test --manifest-path quinn/Cargo.toml --no-default-features --features rustls-aws-lc-rs-fips,runtime-tokio

wasm_test:
name: test wasm32-unknown-unknown
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4

- name: Install stable toolchain
uses: dtolnay/rust-toolchain@stable

- name: Add wasm target
run: rustup target add wasm32-unknown-unknown

- name: Install nodejs v20
uses: actions/setup-node@v4
with:
node-version: 20

- name: Setup `wasm-tools`
uses: bytecodealliance/actions/wasm-tools/setup@v1

- name: Install cargo binstall
uses: cargo-bins/cargo-binstall@main

- name: build wasm32 tests (quinn-proto)
run: cargo test -p quinn-proto --target wasm32-unknown-unknown --no-run

# If the Wasm file contains any 'import "env"' declarations, then
# some non-Wasm-compatible code made it into the final code.
- name: Check for 'import "env"' in Wasm
run: |
! wasm-tools print --skeleton target/wasm32-unknown-unknown/debug/deps/quinn_proto-*.wasm | grep 'import "env"'

- name: Install wasm-bindgen-test-runner
run: cargo binstall wasm-bindgen-cli --locked --no-confirm

- name: wasm32 test (quinn-proto)
run: cargo test -p quinn-proto --target wasm32-unknown-unknown

msrv:
runs-on: ubuntu-latest
steps:
Expand Down
10 changes: 7 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ clap = { version = "4", features = ["derive"] }
crc = "3"
directories-next = "2"
futures-io = "0.3.19"
getrandom = { version = "0.2", default-features = false }
hdrhistogram = { version = "7.2", default-features = false }
hex-literal = "0.4"
lazy_static = "1"
Expand All @@ -36,20 +37,23 @@ ring = "0.17"
rustc-hash = "2"
rustls = { version = "0.23.5", default-features = false, features = ["std"] }
rustls-pemfile = "2"
rustls-platform-verifier = "0.3"
rustls-platform-verifier = "0.4"
rustls-pki-types = "1.7"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1"
slab = "0.4.6"
smol = "2"
socket2 = "0.5"
thiserror = "1.0.21"
thiserror = "2.0.3"
tinyvec = { version = "1.1", features = ["alloc"] }
tokio = { version = "1.28.1", features = ["sync"] }
tracing = { version = "0.1.10", default-features = false, features = ["std"] }
tracing-futures = { version = "0.2.0", default-features = false, features = ["std-future"] }
tracing-subscriber = { version = "0.3.0", default-features = false, features = ["env-filter", "fmt", "ansi", "time", "local-time"] }
url = "2"
windows-sys = { version = "0.59", features = ["Win32_Foundation", "Win32_System_IO", "Win32_Networking_WinSock"] }
wasm-bindgen-test = { version = "0.3.45" }
web-time = "1"
windows-sys = { version = ">=0.52, <=0.59", features = ["Win32_Foundation", "Win32_System_IO", "Win32_Networking_WinSock"] }

[profile.bench]
debug = true
Expand Down
13 changes: 12 additions & 1 deletion quinn-proto/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "quinn-proto"
version = "0.11.8"
version = "0.11.9"
edition.workspace = true
rust-version.workspace = true
license.workspace = true
Expand Down Expand Up @@ -30,6 +30,8 @@ ring = ["dep:ring"]
platform-verifier = ["dep:rustls-platform-verifier"]
# Configure `tracing` to log events via `log` if no `tracing` subscriber exists.
log = ["tracing/log"]
# Enable rustls logging
rustls-log = ["rustls?/logging"]

[dependencies]
arbitrary = { workspace = true, optional = true }
Expand All @@ -45,12 +47,21 @@ thiserror = { workspace = true }
tinyvec = { workspace = true, features = ["alloc"] }
tracing = { workspace = true }

# Feature flags & dependencies for wasm
# wasm-bindgen is assumed for a wasm*-*-unknown target
[target.'cfg(all(target_family = "wasm", target_os = "unknown"))'.dependencies]
ring = { workspace = true, features = ["wasm32_unknown_unknown_js"] }
getrandom = { workspace = true, features = ["js"] }
rustls-pki-types = { workspace = true, features = ["web"] } # only added as dependency to enforce the `web` feature for this target
web-time = { workspace = true }

[dev-dependencies]
assert_matches = { workspace = true }
hex-literal = { workspace = true }
rcgen = { workspace = true }
tracing-subscriber = { workspace = true }
lazy_static = "1"
wasm-bindgen-test = { workspace = true }

[lints.rust]
# https://rust-fuzz.github.io/book/cargo-fuzz/guide.html#cfgfuzzing
Expand Down
3 changes: 2 additions & 1 deletion quinn-proto/src/cid_generator.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
use std::{hash::Hasher, time::Duration};
use std::hash::Hasher;

use rand::{Rng, RngCore};

use crate::shared::ConnectionId;
use crate::Duration;
use crate::MAX_CID_SIZE;

/// Generates connection IDs for incoming connections
Expand Down
5 changes: 2 additions & 3 deletions quinn-proto/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ use std::{
net::{SocketAddrV4, SocketAddrV6},
num::TryFromIntError,
sync::Arc,
time::Duration,
};

#[cfg(any(feature = "rustls-aws-lc-rs", feature = "rustls-ring"))]
Expand All @@ -19,8 +18,8 @@ use crate::{
congestion,
crypto::{self, HandshakeTokenKey, HmacKey},
shared::ConnectionId,
RandomConnectionIdGenerator, VarInt, VarIntBoundsExceeded, DEFAULT_SUPPORTED_VERSIONS,
INITIAL_MTU, MAX_CID_SIZE, MAX_UDP_PAYLOAD,
Duration, RandomConnectionIdGenerator, VarInt, VarIntBoundsExceeded,
DEFAULT_SUPPORTED_VERSIONS, INITIAL_MTU, MAX_CID_SIZE, MAX_UDP_PAYLOAD,
};

/// Parameters governing the core QUIC state machine
Expand Down
2 changes: 1 addition & 1 deletion quinn-proto/src/congestion.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
//! Logic for controlling the rate at which data is sent

use crate::connection::RttEstimator;
use crate::Instant;
use std::any::Any;
use std::sync::Arc;
use std::time::Instant;

mod bbr;
mod cubic;
Expand Down
2 changes: 1 addition & 1 deletion quinn-proto/src/congestion/bbr/bw_estimation.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use std::fmt::{Debug, Display, Formatter};
use std::time::{Duration, Instant};

use super::min_max::MinMax;
use crate::{Duration, Instant};

#[derive(Clone, Debug)]
pub(crate) struct BandwidthEstimation {
Expand Down
2 changes: 1 addition & 1 deletion quinn-proto/src/congestion/bbr/mod.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
use std::any::Any;
use std::fmt::Debug;
use std::sync::Arc;
use std::time::{Duration, Instant};

use rand::{Rng, SeedableRng};

use crate::congestion::bbr::bw_estimation::BandwidthEstimation;
use crate::congestion::bbr::min_max::MinMax;
use crate::connection::RttEstimator;
use crate::{Duration, Instant};

use super::{Controller, ControllerFactory, BASE_DATAGRAM_SIZE};

Expand Down
4 changes: 2 additions & 2 deletions quinn-proto/src/congestion/cubic.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
use std::any::Any;
use std::cmp;
use std::sync::Arc;
use std::time::{Duration, Instant};

use super::{Controller, ControllerFactory, BASE_DATAGRAM_SIZE};
use crate::connection::RttEstimator;
use std::cmp;
use crate::{Duration, Instant};

/// CUBIC Constants.
///
Expand Down
2 changes: 1 addition & 1 deletion quinn-proto/src/congestion/new_reno.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
use std::any::Any;
use std::sync::Arc;
use std::time::Instant;

use super::{Controller, ControllerFactory, BASE_DATAGRAM_SIZE};
use crate::connection::RttEstimator;
use crate::Instant;

/// A simple, standard congestion controller
#[derive(Debug, Clone)]
Expand Down
2 changes: 1 addition & 1 deletion quinn-proto/src/connection/ack_frequency.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use crate::connection::spaces::PendingAcks;
use crate::frame::AckFrequency;
use crate::transport_parameters::TransportParameters;
use crate::Duration;
use crate::{AckFrequencyConfig, TransportError, VarInt, TIMER_GRANULARITY};
use std::time::Duration;

/// State associated to ACK frequency
pub(super) struct AckFrequencyState {
Expand Down
7 changes: 2 additions & 5 deletions quinn-proto/src/connection/cid_state.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
//! Maintain the state of local connection IDs
use std::{
collections::VecDeque,
time::{Duration, Instant},
};
use std::collections::VecDeque;

use rustc_hash::FxHashSet;
use tracing::{debug, trace};

use crate::{shared::IssuedCid, TransportError};
use crate::{shared::IssuedCid, Duration, Instant, TransportError};

/// Local connection ID management
pub(super) struct CidState {
Expand Down
2 changes: 1 addition & 1 deletion quinn-proto/src/connection/datagrams.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ pub struct Datagrams<'a> {
pub(super) conn: &'a mut Connection,
}

impl<'a> Datagrams<'a> {
impl Datagrams<'_> {
/// Queue an unreliable, unordered datagram for immediate transmission
///
/// If `drop` is true, previously queued datagrams which are still unsent may be discarded to
Expand Down
Loading