Bug #27099: system_mysql fail in pushbuild windows

On Windows the debug log was doing freopen () instead of
fflush() and that was slowing the logging down that much 
that some tests timed out.
Fixed by replacing the freopen() with an syncing-to-disk
flag to fopen() and fflush().
Also increased the timeout of the tests running with --debug
on windows : seems to slow down as much as valgrind on linux.
parent 88aa7b0a
...@@ -1826,7 +1826,13 @@ static void DBUGOpenFile(CODE_STATE *cs, ...@@ -1826,7 +1826,13 @@ static void DBUGOpenFile(CODE_STATE *cs,
else else
{ {
newfile= !EXISTS(name); newfile= !EXISTS(name);
if (!(fp= fopen(name, append ? "a+" : "w"))) if (!(fp= fopen(name,
#if defined(MSDOS) || defined(__WIN__)
append ? "a+c" : "wc"
#else
append ? "a+" : "w"
#endif
)))
{ {
(void) fprintf(stderr, ERR_OPEN, cs->process, name); (void) fprintf(stderr, ERR_OPEN, cs->process, name);
perror(""); perror("");
...@@ -2229,26 +2235,12 @@ static void dbug_flush(CODE_STATE *cs) ...@@ -2229,26 +2235,12 @@ static void dbug_flush(CODE_STATE *cs)
{ {
#ifndef THREAD #ifndef THREAD
if (cs->stack->flags & FLUSH_ON_WRITE) if (cs->stack->flags & FLUSH_ON_WRITE)
#endif
{
#if defined(MSDOS) || defined(__WIN__)
if (cs->stack->out_file != stdout && cs->stack->out_file != stderr)
{
if (!(freopen(cs->stack->name,"a",cs->stack->out_file)))
{
(void) fprintf(stderr, ERR_OPEN, cs->process, cs->stack->name);
fflush(stderr);
cs->stack->out_file= stderr;
}
}
else
#endif #endif
{ {
(void) fflush(cs->stack->out_file); (void) fflush(cs->stack->out_file);
if (cs->stack->delay) if (cs->stack->delay)
(void) Delay(cs->stack->delay); (void) Delay(cs->stack->delay);
} }
}
if (!cs->locked) if (!cs->locked)
pthread_mutex_unlock(&THR_LOCK_dbug); pthread_mutex_unlock(&THR_LOCK_dbug);
} /* dbug_flush */ } /* dbug_flush */
......
...@@ -1019,12 +1019,14 @@ sub command_line_setup () { ...@@ -1019,12 +1019,14 @@ sub command_line_setup () {
{ {
$opt_testcase_timeout= $default_testcase_timeout; $opt_testcase_timeout= $default_testcase_timeout;
$opt_testcase_timeout*= 10 if $opt_valgrind; $opt_testcase_timeout*= 10 if $opt_valgrind;
$opt_testcase_timeout*= 10 if ($opt_debug and $glob_win32);
} }
if ( ! $opt_suite_timeout ) if ( ! $opt_suite_timeout )
{ {
$opt_suite_timeout= $default_suite_timeout; $opt_suite_timeout= $default_suite_timeout;
$opt_suite_timeout*= 6 if $opt_valgrind; $opt_suite_timeout*= 6 if $opt_valgrind;
$opt_suite_timeout*= 6 if ($opt_debug and $glob_win32);
} }
if ( ! $opt_user ) if ( ! $opt_user )
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment