thin-provisioning-tools
thin-provisioning-tools copied to clipboard
unit tests fail on tmpfs due to O_DIRECT
The unit tests open all files with O_DIRECT. O_DIRECT does not work on tmpfs and maybe others. Also it makes testing need unnecessary long, as the kernel is forced to write the date to disk any time. For the Debian package I currently use a preload library as workaround. But maybe this should be fixed more central.
How long is it taking the tests to run for you?
On Sun, 7 Feb 2016 at 11:40 Bastian [email protected] wrote:
The unit tests open all files with O_DIRECT O_DIRECT does not work on tmpfs and maybe others Also it makes testing need unnecessary long, as the kernel is forced to write the date to disk any time For the Debian package I currently use a preload library as workaround But maybe this should be fixed more central
— Reply to this email directly or view it on GitHub https://github.com/jthornber/thin-provisioning-tools/issues/38.
Up to 20 minutes, depending on the hardware platform. However this is only secondary. First they need to run at all, and with O_DIRECT they just don't.
The tools need to use DIRECT_IO though, and I don't want to water down the effectiveness of the tests by having them not exercise the real code paths. So I think your LD_PRELOAD solution is going to have to stay.
If the duration of the tests is bothering you, knock out the bloom filter tests. They were written for an alternative design for the dm-era target, and aren't needed.
- Joe
On Mon, 8 Feb 2016 at 06:25 Bastian [email protected] wrote:
Up to 20 minutes, depending on the hardware platform. However this is only secondary. First they need to run at all, and with O_DIRECT they just don't.
— Reply to this email directly or view it on GitHub https://github.com/jthornber/thin-provisioning-tools/issues/38#issuecomment-181222410 .
On Mon, Feb 08, 2016 at 03:06:25AM -0800, Joe Thornber wrote:
The tools need to use DIRECT_IO though, and I don't want to water down the effectiveness of the tests by having them not exercise the real code paths. So I think your LD_PRELOAD solution is going to have to stay.
As the workaround does not work reliable, I'll fix it correctly later
Bastian
You're dead, Jim. -- McCoy, "The Tholian Web", stardate unknown
the bloom tests seem to hang for me ... at least i didn't bother waiting around. if they are no longer useful, can we cull them ?
This is still a problem
unit-tests/unit_tests
[==========] Running 189 tests from 25 test cases.
[----------] Global test environment set-up.
[----------] 7 tests from ArrayBlockTests
[ RUN ] ArrayBlockTests.can_create_an_empty_array
unknown file: Failure
C++ exception with description "syscall 'open' failed: Invalid argument
Note: you cannot run this tool with these options on live metadata." thrown in the test body.
[ FAILED ] ArrayBlockTests.can_create_an_empty_array (5 ms)
[ RUN ] ArrayBlockTests.read_only_array_blocks_are_possible
unknown file: Failure
C++ exception with description "syscall 'open' failed: Invalid argument
Note: you cannot run this tool with these options on live metadata." thrown in the test body.
[ FAILED ] ArrayBlockTests.read_only_array_blocks_are_possible (4 ms)
[ RUN ] ArrayBlockTests.updating_reopened_array_block
unknown file: Failure
C++ exception with description "syscall 'open' failed: Invalid argument
Note: you cannot run this tool with these options on live metadata." thrown in the test body.
[ FAILED ] ArrayBlockTests.updating_reopened_array_block (4 ms)
[ RUN ] ArrayBlockTests.growing
unknown file: Failure
C++ exception with description "syscall 'open' failed: Invalid argument
Note: you cannot run this tool with these options on live metadata." thrown in the test body.
[ FAILED ] ArrayBlockTests.growing (5 ms)
[ RUN ] ArrayBlockTests.grow_does_not_touch_existing_values
unknown file: Failure
C++ exception with description "syscall 'open' failed: Invalid argument
Note: you cannot run this tool with these options on live metadata." thrown in the test body.
[ FAILED ] ArrayBlockTests.grow_does_not_touch_existing_values (4 ms)
[ RUN ] ArrayBlockTests.shrinking
unknown file: Failure
C++ exception with description "syscall 'open' failed: Invalid argument
Note: you cannot run this tool with these options on live metadata." thrown in the test body.
[ FAILED ] ArrayBlockTests.shrinking (3 ms)
[ RUN ] ArrayBlockTests.ref_counting
unknown file: Failure
C++ exception with description "syscall 'open' failed: Invalid argument
Note: you cannot run this tool with these options on live metadata." thrown in the test body.
[ FAILED ] ArrayBlockTests.ref_counting (3 ms)
[----------] 7 tests from ArrayBlockTests (28 ms total)
[----------] 7 tests from ArrayTests
[ RUN ] ArrayTests.can_create_an_empty_array
unknown file: Failure
C++ exception with description "syscall 'open' failed: Invalid argument
Note: you cannot run this tool with these options on live metadata." thrown in the test fixture's constructor.
make: *** [unit-tests/Makefile:93: unit-test] Segmentation fault
* ERROR: sys-block/thin-provisioning-tools-0.7.0::gentoo failed (test phase):
* emake failed
This looks like a permissions issue. Could you strace the test and exactly what the issue is please.
It's not permissions, it's still trying to use O_DIRECT
on a filesystem where it's not supported.
--- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=26531, si_uid=0, si_status=0, si_utime=0, si_stime=0} ---
stat("./test.data", 0x7fffabc01510) = -1 ENOENT (No such file or directory)
open("./test.data", O_RDWR|O_CREAT|O_EXCL|O_DIRECT, 0666) = -1 EINVAL (Invalid argument)
futex(0x7fecc52001a0, FUTEX_WAKE_PRIVATE, 2147483647) = 0
write(1, "unknown file: Failure\nC++ except"..., 94unknown file: Failure
C++ exception with description "syscall 'open' failed: Invalid argument