Skip to content
Snippets Groups Projects
Commit 1875a641 authored by Tomáš Pecka's avatar Tomáš Pecka
Browse files

wip #137

parent e07e44e8
No related branches found
No related tags found
No related merge requests found
Pipeline #33921 failed
......@@ -6,6 +6,7 @@
#include <unistd.h>
#include <sys/wait.h>
#include <signal.h>
#include <string.h>
 
#include <global/GlobalData.h>
 
......@@ -134,12 +135,12 @@ void _TimeoutAqlTest ( const std::chrono::microseconds & timeout, const ext::vec
close ( pipefd [ PIPE_WR ] );
 
if ( WIFEXITED ( status ) ) {
// std::cerr << "Child process finished, code " << WEXITSTATUS ( status ) << std::endl;
INFO ( "AqlTest failure. Trying to execute: " << queries );
INFO ( "Child output was: >" << childOutput << "<" );
REQUIRE ( WEXITSTATUS ( status ) == 0 );
} else if ( WIFSIGNALED ( status ) ) {
// std::cerr << "Child process signaled, signal ", WTERMSIG ( status ) << std::endl;
WARN ( "Timeout (" << timeout.count ( ) << " us) reached in test (" << queries << ")" );
WARN ( "Child process signaled, signal " << WTERMSIG ( status ) << " (" << strsignal ( WTERMSIG ( status ) ) << ")" );
if ( WTERMSIG ( status ) == SIGTERM || WTERMSIG ( status ) == SIGKILL ) /* killed */
WARN ( "Timeout (" << timeout.count ( ) << " us) reached in test (" << queries << ")" );
}
}
......@@ -12,3 +12,20 @@ TEST_CASE ( "Dummy Test", "[integration][dummy][!mayfail]" ) {
 
TimeoutAqlTest ( 1s, qs );
}
TEST_CASE ( "Segfault Test", "[integration][dummy][!shouldfail]" ) {
ext::vector < std::string > qs = {
"execute \"generated some output\"",
"execute debug::Segfault"
};
TimeoutAqlTest ( 1s, qs );
}
TEST_CASE ( "Timeout Test", "[integration][dummy][!shouldfail]" ) {
ext::vector < std::string > qs = {
"execute \"generated some output\"",
};
TimeoutAqlTest ( 1us, qs );
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment