Skip to content

Commit efe13fa

Browse files
committed
improve testing coverage
1 parent 0765016 commit efe13fa

File tree

2 files changed

+19
-9
lines changed

2 files changed

+19
-9
lines changed

.github/workflows/coverage.yml

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ env:
1616

1717
jobs:
1818
coverage:
19-
name: Run cargo coverage
20-
runs-on: ubuntu-latest
19+
name: Run cargo coverage on ${{ matrix.os }}
20+
runs-on: ${{ matrix.os }}
2121
steps:
2222
- name: Checkout sources
2323
uses: actions/checkout@v4
@@ -31,10 +31,21 @@ jobs:
3131
- name: Install cargo-llvm-cov
3232
uses: taiki-e/install-action@cargo-llvm-cov
3333
- name: Generate code coverage
34-
run: sudo bash -c "ulimit -Sl 512 && ulimit -Hl 512 && sudo -u runner /home/runner/.cargo/bin/cargo llvm-cov --release --all --lcov --output-path lcov.info"
34+
run: bash -c "${{ matrix.cargo }} llvm-cov --release --all --lcov --output-path lcov.info"
3535
- name: Generate code coverage with all features
36-
run: sudo bash -c "ulimit -Sl 512 && ulimit -Hl 512 && sudo -u runner /home/runner/.cargo/bin/cargo llvm-cov --all-features --release --all --lcov --output-path lcov-all-features.info"
36+
run: bash -c "${{ matrix.cargo }} llvm-cov --all-features --release --all --lcov --output-path lcov-all-features.info"
3737
- name: Upload coverage to Codecov
3838
run: |
3939
bash <(curl -s https://codecov.io/bash) -f lcov.info -t ${{ env.CODECOV_TOKEN }}
4040
bash <(curl -s https://codecov.io/bash) -f lcov-all-features.info -t ${{ env.CODECOV_TOKEN }}
41+
42+
strategy:
43+
fail-fast: false
44+
matrix:
45+
include:
46+
- os: ubuntu-latest
47+
cargo: ulimit -Sl 512 && ulimit -Hl 512 && sudo -u runner /home/runner/.cargo/bin/cargo
48+
- os: macos-14
49+
cargo: ulimit -Sl 512 && ulimit -Hl 512 && sudo -u runner /Users/runner/.cargo/bin/cargo
50+
- os: windows-latest
51+
cargo: C://Users//runneradmin//.cargo//bin//cargo.exe

core/src/co_pool/mod.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use crate::common::ordered_work_steal::{OrderedLocalQueue, OrderedWorkStealQueue
66
use crate::common::{get_timeout_time, now, CondvarBlocker};
77
use crate::coroutine::suspender::Suspender;
88
use crate::scheduler::{SchedulableCoroutine, Scheduler};
9-
use crate::{impl_current_for, impl_display_by_debug, impl_for_named, trace};
9+
use crate::{error, impl_current_for, impl_display_by_debug, impl_for_named, trace};
1010
use dashmap::DashMap;
1111
use std::cell::Cell;
1212
use std::ffi::c_longlong;
@@ -70,10 +70,9 @@ impl Drop for CoroutinePool<'_> {
7070
self.get_running_size(),
7171
"There are still tasks in progress !"
7272
);
73-
assert!(
74-
self.task_queue.is_empty(),
75-
"There are still tasks to be carried out !"
76-
);
73+
if self.task_queue.is_empty() {
74+
error!("Forget some tasks when closing the pool");
75+
}
7776
}
7877
}
7978

0 commit comments

Comments
 (0)