Skip to content

Timers::oneshot() not reliable? #2356

@mazunki

Description

@mazunki

The integration test for kernel/block is flaky on my end. Since it was failing for me a few times I decided to test it:

#!/bin/sh
# repeat-test.sh
count=$1; shift

run() {
  if "$@"; then ok=$((ok + 1))
  else err=$((err + 1))
  fi
}

echo "running test ${count} times: $*"

ok=0; err=0
while [ "$count" -gt 0 ]; do
  count=$((count - 1))
  run "$@" >/dev/null 2>/dev/null
done

printf "summary:\n  ok=%d\n  err=%d\n" "${ok}" "${err}"
./repeat-test.sh 100 \
  nix-build ./unikernel.nix \
    --argstr unikernel ./test/integration/kernel/block \
    --check \
    --arg doCheck true

Which reports 2 failures. I didn't dig too deep into the source of the fault, but the test does call Timers::oneshot() => Timers::periodic(). When it fails, it fails on the very first iteration of the test too from what I have observed (could be a coincidence).

@MagnusS Introducing a way to repeat tests to detect these sporadic failures is probably a good idea.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions