#!/usr/bin/env bash
# SPDX-License-Identifier: BSD-3-Clause
# Copyright 2014-2019, Intel Corporation

#
# src/test/blk_rw_mt/TEST2 -- unit test for MT I/O on blk pool
#

. ../unittest/unittest.sh

# this is the long version of the test
require_test_type long

# libpmemblk does not support race detection tools
configure_valgrind helgrind force-disable
configure_valgrind drd force-disable

# doesn't make sense to run in local directory
require_fs_type pmem non-pmem

setup

# limit number of emitted logs due to excessive log size
export PMEMBLK_LOG_LEVEL=2

truncate -s 1G $DIR/testfile1
# 300 threads, each doing 100000 random I/Os
expect_normal_exit ./blk_rw_mt$EXESUFFIX 4096 $DIR/testfile1 789 300 100000

check_pool $DIR/testfile1

check

pass
