-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[qtest-parallel testing] C++ exception with description "cannot open file test-file: No such file or directory" thrown in the test body. #3878
Comments
In general we don't support parallel tests but if it's the only issue, a PR to change file name(s) to avoid conflict would be welcome. |
uniq test file names for the os-test suite (fmtlib#3878 issue).
Indeed the problem described here can be resolved as the following: TEST(file_test, read_error) { I've detected this bug when moved this test case on the top of file. |
uniq test file names for the os-test suite (#3878 issue).
uniq test file names for the os-test suite (fmtlib#3878 issue).
Probably, there are some problems with test sources for FMT project.
When I start the testing with qtest-parallel the following exception is thrown sometimes:
C++ exception with description "cannot open file test-file: No such file or directory" thrown in the test body.
Possible, I've found out a root cause of this issue and I'm going to share my concerns with you.
Lets to consider two tests, namely:
TEST(file_test, read_error) {
file f("test-file", file::WRONLY);
char buf; // We intentionally read from a file opened in the write-only mode to
// cause error.
EXPECT_SYSTEM_ERROR(f.read(&buf, 1), EBADF, "cannot read from file");
}
TEST(file_test, write_error) {
file f("test-file", file::RDONLY);
// We intentionally write to a file opened in the read-only mode to
// cause error.
EXPECT_SYSTEM_ERROR(f.write(" ", 1), EBADF, "cannot write to file");
}
These tests work w/ the file that has a similar name, namely, test-file .
I suppose, this file can be removed when one test closes it whereas another uses this file a while.
Certainly, I mean the testing in the parallel mode. In my opinion here the exception mentioned above can be thrown rarely.
Could you please confirm or deny my guesses?
Thanks in advance,
Vladimir.
PS. I've prepared a patch that we're using for our CI stand to suppress the problem described there.
You can look at it if you're wondering.
fmt.patch.txt
The text was updated successfully, but these errors were encountered: