Skip to content

Commit

Permalink
fix: aead unit tests no longer deadlock
Browse files Browse the repository at this point in the history
* fix: add back unit tests and configure rayon threadpool

* Use env var to set rayon threads.

* Remove `rayon` dev dependency.
  • Loading branch information
th4s authored Sep 2, 2024
1 parent d179150 commit 32df138
Show file tree
Hide file tree
Showing 3 changed files with 297 additions and 294 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ on:
env:
CARGO_TERM_COLOR: always
CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse
# We need a higher number of parallel rayon tasks than the default (which is 4)
# in order to prevent a deadlock, c.f.
# - https://github.com/tlsnotary/tlsn/issues/548
# - https://github.com/privacy-scaling-explorations/mpz/issues/178
# 32 seems to be big enough for the foreseeable future
RAYON_NUM_THREADS: 32

jobs:
fmt:
Expand Down
8 changes: 4 additions & 4 deletions crates/components/aead/src/aes_gcm/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ impl AesGcmError {
}
}

// #[cfg(test)]
// pub(crate) fn kind(&self) -> ErrorKind {
// self.kind
// }
#[cfg(test)]
pub(crate) fn kind(&self) -> ErrorKind {
self.kind
}

pub(crate) fn invalid_tag() -> Self {
Self {
Expand Down
Loading

0 comments on commit 32df138

Please sign in to comment.