Skip to content

Commit

Permalink
Merge pull request #387 from moka-rs/stabilize-flaky-drop-cache-test
Browse files Browse the repository at this point in the history
CI: Stabilize `ensure_gc_runs_when_dropping_cache` test for `sync::Cache`
  • Loading branch information
tatsuya6502 authored Jan 21, 2024
2 parents 521193a + 865c680 commit 1c1d32e
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 1 deletion.
6 changes: 6 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,12 @@ jobs:
command: test
args: --release --lib --features sync sync::segment::tests::drop_value_immediately_after_eviction -- --exact --ignored

- name: Run tests (sync feature, drop cache)
uses: actions-rs/cargo@v1
with:
command: test
args: --release --lib --features sync sync::cache::tests::ensure_gc_runs_when_dropping_cache -- --exact --ignored

- name: Run tests (future feature, but no sync feature)
uses: actions-rs/cargo@v1
with:
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/CIQuantaDisabled.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,3 +93,9 @@ jobs:
with:
command: test
args: --no-default-features --features 'sync, future, atomic64, logging'

- name: Run tests (sync feature, but no quanta feature, drop cache)
uses: actions-rs/cargo@v1
with:
command: test
args: --release --lib --no-default-features --features sync sync::cache::tests::ensure_gc_runs_when_dropping_cache -- --exact --ignored
6 changes: 6 additions & 0 deletions .github/workflows/LinuxCrossCompileTest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,9 @@ jobs:
run: |
cross ${{ matrix.platform.cargo-version }} test --release -F future \
--target ${{ matrix.platform.target }} ${{ matrix.platform.cargo-opts }}
- name: Run tests (sync feature, drop cache)
run: |
cross ${{ matrix.platform.cargo-version }} test --release -F sync \
--target ${{ matrix.platform.target }} ${{ matrix.platform.cargo-opts }} \
--lib sync::cache::tests::ensure_gc_runs_when_dropping_cache -- --exact --ignored
6 changes: 5 additions & 1 deletion src/sync/cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4831,8 +4831,12 @@ mod tests {
assert_eq!(counters.value_dropped(), KEYS, "value_dropped");
}

// https://github.com/moka-rs/moka/issues/383
// For testing the issue reported by: https://github.com/moka-rs/moka/issues/383
//
// Ignored by default. This test becomes unstable when run in parallel with
// other tests.
#[test]
#[ignore]
fn ensure_gc_runs_when_dropping_cache() {
let cache = Cache::builder().build();
let val = Arc::new(0);
Expand Down

0 comments on commit 1c1d32e

Please sign in to comment.