Changeset: 2dfd46aa9979 for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=2dfd46aa9979 Modified Files: gdk/gdk_logger.c testing/Mtest.py.in Branch: default Log Message:
Merge with Jan2014 branch. diffs (97 lines): diff --git a/gdk/gdk_logger.c b/gdk/gdk_logger.c --- a/gdk/gdk_logger.c +++ b/gdk/gdk_logger.c @@ -1440,9 +1440,18 @@ logger_new(int debug, char *fn, char *lo fclose(fp1); /* first create a versioned file using * the current log id */ - fp1 = fopen(cvfile, "w"); - fprintf(fp1, "%d\n", curid); - fclose(fp1); + if ((fp1 = fopen(cvfile, "w")) == NULL || + fprintf(fp1, "%d\n", curid) < 2 || + fflush(fp1) != 0 || /* make sure it's save on disk */ +#if defined(_MSC_VER) + _commit(_fileno(fp1)) < 0 || +#elif defined(HAVE_FDATASYNC) + fdatasync(fileno(fp1)) < 0 || +#elif defined(HAVE_FSYNC) + fsync(fileno(fp1)) < 0 || +#endif + fclose(fp1) != 0) + logger_fatal("Logger_new: failed to write %s\n", cvfile, 0, 0); /* then remove the unversioned file * that gdk_bbp created (in this * order!) */ diff --git a/testing/Mtest.py.in b/testing/Mtest.py.in --- a/testing/Mtest.py.in +++ b/testing/Mtest.py.in @@ -2084,6 +2084,8 @@ def RunTest(env, TST, BusyPorts, COND, o errcode = F_SEGV elif tres == 'abort': errcode = F_ABRT + elif tres == 'socket': + errcode = F_SOCK elif tres == 'error': errcode = F_WARN elif tres is not None: @@ -2106,6 +2108,12 @@ def RunTest(env, TST, BusyPorts, COND, o ##rm -f .new.left-over.tmp.bats. $TSTTRGBASE/Tests/.old.left-over.tmp.bats. ##if [ -f .all.left-over.tmp.bats. ] ; then mv -f .all.left-over.tmp.bats. $TSTTRGBASE/Tests/.old.left-over.tmp.bats. ; fi + if tres == 'socket': + if quiet: + STDOUT.write("\n%s : Socket!\n" % TST) + elif verbose: + STDOUT.write("(Socket!) ") + if tres == 'timeout': if quiet: STDOUT.write("\n%s : Timeout!\n" % TST) @@ -2344,7 +2352,9 @@ def RunTest(env, TST, BusyPorts, COND, o FailedOut, FailedErr) if not verbose and not quiet: - if tres == 'timeout': + if tres == 'socket': + STDOUT.write("%sSOCKET%s" % (PURPLE, BLACK)) + elif tres == 'timeout': STDOUT.write("%sTIMEOUT%s" % (PURPLE, BLACK)) elif tres == 'recursion': STDOUT.write("%sRECURSION%s" % (PURPLE, BLACK)) @@ -2965,22 +2975,20 @@ def DoIt(env, SERVER, CALL, TST, EXT, PR return None # Try to detect segfaults and the like - TO = re.compile("(^(|[^#]*[\t ])((Memory|Segmentation) [Ff]ault|Bus [Ee]rror|Aborted|Assertion (|.* )failed[:\.]|!FATAL: BATSIGabort:)([ \t]|$))", re.MULTILINE) - # FIXME: this begs for a much nicer solution (100% copy of below) - for f in (TestErrFile, TestOutFile): - if os.path.isfile(f): - for l in open(f): - if TO.search(l): - return 'segfault' - # Try to detect aborts due to too deep recursion - TO = re.compile("aborted too deep recursion", re.MULTILINE) - # FIXME: this begs for a much nicer solution (100% copy of above) - for f in (TestErrFile, TestOutFile): - if os.path.isfile(f): - for l in open(f): - if TO.search(l): - return 'recursion' + for (regexp, msg) in [("(^(|[^#]*[\t ])((Memory|Segmentation) [Ff]ault|Bus [Ee]rror|Aborted|Assertion (|.* )failed[:\.]|!FATAL: BATSIGabort:)([ \t]|$))", + 'segfault'), + ("aborted too deep recursion", + 'recursion'), + ("mal_mapi\.listen:operation failed: bind to stream socket port", + 'socket')]: + TO = re.compile(regexp, re.MULTILINE) + # FIXME: this begs for a much nicer solution (100% copy of below) + for f in (TestErrFile, TestOutFile): + if os.path.isfile(f): + for l in open(f): + if TO.search(l): + return msg return None _______________________________________________ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list