Skip to content

Commit

Permalink
CI: Skip tests requiring large memory on AWS Graviton (arm64)
Browse files Browse the repository at this point in the history
  • Loading branch information
tatsuya6502 committed Jul 13, 2024
1 parent ad7eedc commit c8db0a1
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 20 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ jobs:
# 2-core CPU (x86_64), 7 GB of RAM
- name: Show CPU into
run: |
nproc
echo "nproc: $(nproc)"
free -m
lscpu
- name: Install Rust toolchain
Expand Down
11 changes: 8 additions & 3 deletions .github/workflows/CIArm64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ jobs:
# 2-core CPU (x86_64), 7 GB of RAM
- name: Show CPU into
run: |
nproc
echo "nproc: $(nproc)"
free -m
lscpu
- name: Install Rust toolchain
Expand All @@ -59,12 +60,12 @@ jobs:
- name: Run tests (debug, sync feature)
run: cargo test --features sync
env:
RUSTFLAGS: '--cfg rustver'
RUSTFLAGS: '--cfg rustver --cfg skip_large_mem_tests'

- name: Run tests (release, sync feature)
run: cargo test --release --features sync
env:
RUSTFLAGS: '--cfg rustver'
RUSTFLAGS: '--cfg rustver --cfg skip_large_mem_tests'

- name: Run tests (sync feature, key lock test for notification)
run: cargo test --release --lib --features sync sync::cache::tests::test_key_lock_used_by_immediate_removal_notifications -- --exact --ignored
Expand All @@ -80,6 +81,10 @@ jobs:

- name: Run tests (future feature, but no sync feature)
run: cargo test --no-default-features --features 'future, atomic64, quanta'
env:
RUSTFLAGS: '--cfg skip_large_mem_tests'

- name: Run tests (future, sync and logging features)
run: cargo test --features 'future, sync, logging'
env:
RUSTFLAGS: '--cfg skip_large_mem_tests'
4 changes: 2 additions & 2 deletions .github/workflows/Kani.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ jobs:

- name: Show CPU into
run: |
nproc
lscpu
echo "nproc: $(nproc)"
free -m
lscpu
- name: Pin some dependencies to specific versions
run: ./.ci_extras/pin-crate-vers-kani.sh
Expand Down
1 change: 0 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
"benmanes",
"cfgs",
"CHECKME",
"circleci",
"CLFU",
"clippy",
"Codecov",
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ repository = "https://github.com/moka-rs/moka"
keywords = ["cache", "concurrent"]
categories = ["caching", "concurrency"]
readme = "README.md"
exclude = [".circleci", ".cirrus.yml", ".devcontainer", ".github", ".gitpod.yml", ".vscode"]
exclude = [".devcontainer", ".github", ".gitpod.yml", ".vscode"]
build = "build.rs"

[features]
Expand Down
2 changes: 1 addition & 1 deletion build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
const ALLOWED_CFG_NAMES: &[&str] = &[
"armv5te",
"beta_clippy",
"circleci",
"kani",
"mips",
"rustver",
"skip_large_mem_tests",
"trybuild",
];

Expand Down
10 changes: 3 additions & 7 deletions src/cht/segment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1393,14 +1393,10 @@ mod tests {
NUM_VALUES - key_parents.iter().filter(|k| k.was_dropped()).count();
let bucket_array_len = map.capacity() * 2;
assert_eq!(bucket_array_len, map.num_segments() * 128 * 2);
if !cfg!(circleci) {
// TODO: FIXME: These assertions sometimes fail when cargo tarpaulin
// is used on Circle CI.
assert!(live_key_count <= bucket_array_len / 10);
assert!(live_key_count <= bucket_array_len / 10);

for this_value_parent in value_parents.iter() {
assert!(this_value_parent.was_dropped());
}
for this_value_parent in value_parents.iter() {
assert!(this_value_parent.was_dropped());
}

for i in 0..NUM_VALUES {
Expand Down
3 changes: 1 addition & 2 deletions src/future/base_cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2954,8 +2954,7 @@ mod tests {
ensure_sketch_len(pot16 + 1, pot(17), "pot16 + 1").await;

// The following tests will allocate large memory (~8GiB).
// Skip when running on Circle CI.
if !cfg!(circleci) {
if !cfg!(skip_large_mem_tests) {
// due to ceiling to next_power_of_two
ensure_sketch_len(pot30 - 1, pot30, "pot30- 1").await;
ensure_sketch_len(pot30, pot30, "pot30").await;
Expand Down
3 changes: 1 addition & 2 deletions src/sync_base/base_cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2682,8 +2682,7 @@ mod tests {
ensure_sketch_len(pot16 + 1, pot(17), "pot16 + 1");

// The following tests will allocate large memory (~8GiB).
// Skip when running on Circle CI.
if !cfg!(circleci) {
if !cfg!(skip_large_mem_tests) {
// due to ceiling to next_power_of_two
ensure_sketch_len(pot30 - 1, pot30, "pot30- 1");
ensure_sketch_len(pot30, pot30, "pot30");
Expand Down

0 comments on commit c8db0a1

Please sign in to comment.