hawkw / sharded-slab

a lock-free concurrent slab (experimental)
MIT License
273 stars 19 forks source link

test: update loom, CI improvements #31

Closed hawkw closed 4 years ago

hawkw commented 4 years ago

This branch updates loomto 0.3, adds a shell script (bin/loom.sh), which runs Loom tests with default values for Loom's configuration variables, and makes a few minor CI tweaks to improve performance by installing smaller Rust toolchains.

The nightly Rust compiler is used to enable Loom's location tracking support. This allows Loom to emit diagnostics that include the caller's source code locations when errors occur. For example, after modifying the code to cause an invalid concurrent mutable access, we get nice panics like this:

---- pool::tests::concurrent_create_clear stdout ----

 ================== Iteration 1 ==================

~~~~~~~~ THREAD 1 ~~~~~~~~
thread 'pool::tests::concurrent_create_clear' panicked at '
Causality violation: Concurrent write accesses to `UnsafeCell`.
      created: src/page/mod.rs:131:19
    write one: thread #0 @ src/page/mod.rs:188:9
    write two: thread #1 @ src/page/mod.rs:188:9
', ...

The tests are compiled in release mode to improve performance, but debug assertions are enabled.

Any arguments to this script are passed to the cargo test invocation.

Fixes #23