Skip to content

Commit

Permalink
update 526330ce063f5ba0b074311a9136f48dcfae7c68
Browse files Browse the repository at this point in the history
  • Loading branch information
tomtomjhj committed Oct 18, 2023
1 parent 9940b70 commit 55330cf
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
9 changes: 8 additions & 1 deletion homework/scripts/grade-list_set.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ source $BASEDIR/grade-utils.sh

run_linters || exit 1

TIMEOUT=1m
export RUST_TEST_THREADS=1


Expand All @@ -26,13 +25,21 @@ RUNNERS=(
"cargo_asan --release"
"cargo_tsan --release"
)
# timeout for each RUNNER
RUNNER_TIMEOUTS=(
30s
180s
180s
180s
)
# the index of the last failed test
fine_grained_fail=${#COMMON_TESTS[@]}
optimistic_fine_grained_fail=${#COMMON_TESTS[@]}
others_failed=false

for r in "${!RUNNERS[@]}"; do
RUNNER=${RUNNERS[r]}
TIMEOUT=${RUNNER_TIMEOUTS[r]}
for t in "${!COMMON_TESTS[@]}"; do
TEST_NAME=${COMMON_TESTS[t]}
# run only if no test has failed yet
Expand Down
4 changes: 3 additions & 1 deletion homework/tests/list_set/optimistic_fine_grained.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ fn read_no_block() {

let guard = pin();
let mut iter = set.iter(&guard);
assert_eq!(*iter.next().unwrap().unwrap(), 1);
assert_eq!(iter.next(), Some(Ok(&1)));

let (done_sender, done_receiver) = bounded(0);
thread::scope(|s| {
Expand All @@ -49,6 +49,8 @@ fn read_no_block() {
.recv_timeout(Duration::from_secs(3))
.expect("Read should not block other operations");
});

assert_eq!(iter.next(), Some(Ok(&2)));
}

/// Cursor should be invalidated when necessary
Expand Down

0 comments on commit 55330cf

Please sign in to comment.