Changeset: 57b89e181eee for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/57b89e181eee
Branch: default
Log Message:

Merge with Dec2025 branch.


diffs (262 lines):

diff --git a/gdk/gdk_heap.c b/gdk/gdk_heap.c
--- a/gdk/gdk_heap.c
+++ b/gdk/gdk_heap.c
@@ -159,7 +159,7 @@ HEAPalloc(Heap *h, size_t nitems, size_t
            !MT_thread_override_limits()) {
                GDKerror("allocating too much memory (current: %zu, requested: 
%zu, limit: %zu)\n", GDKvm_cursize(), h->size, GDK_vm_maxsize);
                if (GDKtriggerusr1 &&
-                   !(ATOMIC_GET(&GDKdebug) & TESTINGMASK))
+                   (ATOMIC_GET(&GDKdebug) & TESTINGMASK))
                        (*GDKtriggerusr1)();
                return GDK_FAIL;
        }
@@ -265,7 +265,7 @@ HEAPextend(Heap *h, size_t size, bool ma
            !MT_thread_override_limits()) {
                GDKerror("allocating too much memory (current: %zu, requested: 
%zu, limit: %zu)\n", GDKvm_cursize(), size - h->size, GDK_vm_maxsize);
                if (GDKtriggerusr1 &&
-                   !(ATOMIC_GET(&GDKdebug) & TESTINGMASK))
+                   (ATOMIC_GET(&GDKdebug) & TESTINGMASK))
                        (*GDKtriggerusr1)();
                return GDK_FAIL;
        }
@@ -782,7 +782,7 @@ HEAPload(Heap *h, const char *nme, const
            !MT_thread_override_limits()) {
                GDKerror("allocating too much memory (current: %zu, requested: 
%zu, limit: %zu)\n", GDKvm_cursize(), h->size, GDK_vm_maxsize);
                if (GDKtriggerusr1 &&
-                   !(ATOMIC_GET(&GDKdebug) & TESTINGMASK))
+                   (ATOMIC_GET(&GDKdebug) & TESTINGMASK))
                        (*GDKtriggerusr1)();
                return GDK_FAIL;
        }
diff --git a/gdk/gdk_logger.c b/gdk/gdk_logger.c
--- a/gdk/gdk_logger.c
+++ b/gdk/gdk_logger.c
@@ -2620,7 +2620,7 @@ log_new(int debug, const char *fn, const
        int max_pending = GDKgetenv_int("wal_max_pending", 5);
        lng max_file_size = 0;
 
-       if (GDKdebug & TESTINGMASK) {
+       if (ATOMIC_GET(&GDKdebug) & TESTINGMASK) {
                max_file_size = 2048; /* 2 KiB */
        } else {
                const char *max_file_size_str = GDKgetenv("wal_max_file_size");
@@ -2932,7 +2932,7 @@ log_flush(logger *lg, ulng ts)
                        lg->cur_max_pending *= 2; /* when to warn again */
                        TRC_WARNING(GDK, "Too many pending log files " ULLFMT 
"\n", (lg->id - lg->saved_id));
                        if (GDKtriggerusr1 &&
-                           !(ATOMIC_GET(&GDKdebug) & TESTINGMASK))
+                           (ATOMIC_GET(&GDKdebug) & TESTINGMASK))
                                (*GDKtriggerusr1)();
                }
                /* log files went down, reduce cur_max_pending */
diff --git a/testing/Mtest.py.in b/testing/Mtest.py.in
--- a/testing/Mtest.py.in
+++ b/testing/Mtest.py.in
@@ -64,6 +64,9 @@ fbre = re.compile(r' (?P<bats>\d+) free 
 ubre = re.compile(r' (?P<bats>\d+) in use')
 tbre = re.compile(r'^(?P<bats>\d+) bats total')
 
+# collect errors if verbosity == 0
+errors = []
+
 
 # default is no color (these three functions may get redefined)
 def prred(str):
@@ -1370,9 +1373,10 @@ def PerformDir(env, testdir, testlist, t
             elem = AddSubToHtmlIndex(env, TSTDIR, max(FdOut, FdErr, ssout, 
sserr))
         if ssout == F_ERROR or sserr == F_ERROR:
             if verbosity == 0:
-                print('\r', ' '*(ttywidth or 100), '\r', end='', sep='')
-            prred('ERROR')
-            print(f' in directory {TSTDIR}')
+                errors.append(('ERROR', f'in directory {TSTDIR}'))
+            else:
+                prred('ERROR')
+                print(f' in directory {TSTDIR}')
 
         # remove extra files created by tests
         for f in listdir(TSTTRGDIR):
@@ -1856,8 +1860,7 @@ def RunTest(env, TST, COND, oktests, len
                 prred('TEST MISSING')
                 print()
             else:
-                prred('MISSING')
-                print(':', os.path.join(TSTDIR, TSTSUFF, TST + EXT))
+                errors.append(('MISSING', os.path.join(TSTDIR, TSTSUFF, TST + 
EXT)))
 
             return TX,Failed,Failed,elem,reason,links
 
@@ -2184,31 +2187,31 @@ Password = {passwd or "monetdb"}-Wrong
 
         if tres == 'socket':
             if verbosity == 0 and not produce_html:
-                print('\n%s : Socket!' % TST)
+                errors.append(('SOCKET', TST))
             elif verbosity > 1:
                 print('(Socket!) ', end='')
 
         if tres == 'timeout':
             if verbosity == 0 and not produce_html:
-                print('\n%s : Timeout!' % TST)
+                errors.append(('TIMEOUT', TST))
             elif verbosity > 1:
                 print('(Timeout!) ', end='')
 
         if tres == 'recursion':
             if verbosity == 0 and not produce_html:
-                print('\n%s : Recursion!' % TST)
+                errors.append(('RECURSION', TST))
             elif verbosity > 1:
                 print('(Recursion!) ', end='')
 
         if tres == 'segfault':
             if verbosity == 0 and not produce_html:
-                print('\n%s : Crashed!' % TST)
+                errors.append(('CRASHED', TST))
             elif verbosity > 1:
                 print('(Crashed!) ', end='')
 
         if tres == 'signal':
             if verbosity == 0 and not produce_html:
-                print('\n%s : Signaled!' % TST)
+                errors.append(('SIGNALED', TST))
             elif verbosity > 1:
                 print('(Signaled!) ', end='')
 
@@ -2293,10 +2296,15 @@ Password = {passwd or "monetdb"}-Wrong
                 else:
                     diff_html.write('<!--NoDiffs-->\n')
 
-            if verbosity <= 1:
-                if verbosity == 0 and (FailedOut > F_WARN or FailedErr > 
F_WARN):
-                    print('\r', ' '*(ttywidth or 100), end='', sep='')
-                    print('\r', end='', sep='')
+            if verbosity == 0 and (FailedOut > F_WARN or FailedErr > F_WARN):
+                errors.append(({'socket':'SOCKET',
+                                'timeout':'TIMEOUT',
+                                'recursion':'RECURSION',
+                                'segfault':'CRASHED',
+                                'abort':'ABORTED',
+                                'signal':'SIGNALED'}.get(tres, 'ERROR'),
+                               os.path.join(TSTDIR, TSTSUFF, TST + EXT)))
+            elif verbosity == 1:
                 if tres == 'socket':
                     prpurple('SOCKET')
                 elif tres == 'timeout':
@@ -2309,9 +2317,7 @@ Password = {passwd or "monetdb"}-Wrong
                     prpurple('ABORTED')
                 elif tres == 'signal':
                     prpurple('SIGNALED')
-                elif verbosity == 0 and (FailedOut > F_WARN or FailedErr > 
F_WARN):
-                    prred('ERROR')
-                elif verbosity == 1:
+                else:
                     if FailedOut == F_OK:
                         prgreen('OK   ')
                     elif FailedOut == F_WARN:
@@ -2325,10 +2331,7 @@ Password = {passwd or "monetdb"}-Wrong
                         prgreen('minor')
                     else:
                         prred('ERROR')
-                if verbosity == 0 and (FailedOut > F_WARN or FailedErr > 
F_WARN):
-                    print(':', os.path.join(TSTDIR, TSTSUFF, TST + EXT))
-                elif verbosity == 1:
-                    print()
+                print()
         elif FailedOut > F_WARN or FailedErr > F_WARN:
             print()
             print('========================================')
@@ -3032,13 +3035,26 @@ def mapi_ping(port, host='localhost', tr
     return False
 
 
+threadids = {}
+up = '\033[A'
+down = '\033[B'
 def progress(count, total, test, spaces=' '*(ttywidth or 100)):
+    if os.name == 'nt':
+        nl = ''
+        line = 0
+    else:
+        tid = threading.get_ident()
+        nl = ''
+        if tid not in threadids:
+            threadids[tid] = len(threadids)
+            nl = '\n'
+        line = len(threadids) - threadids[tid] - 1
     perc = round((count/total) * 100) if total and count else 0
     s = f'[{count}/{total}] ({perc}%)    {test}'
     if len(s) > ttywidth:
         test = test[len(s)-ttywidth:]
         s = f'[{count}/{total}] ({perc}%)    {test}'
-    sys.stdout.write('\r' + spaces + '\r' + s)
+    sys.stdout.write(nl + '\r' + up*line + spaces + '\r' + s + down*line)
 
 
 def DoIt(env, SERVER, CALL, TST, EXT, TestOutFile, TestErrFile, TIMEOUT, ME, 
length, nomito, threads, user, passwd, COND, PSRVR, total_tests, options, 
TSTDB, TSTDIR, TSTTRGDIR, TSTSRCDIR, environ):
@@ -4416,6 +4432,12 @@ def main(argv):
                         tp = None
             if verbosity == 0:
                 print()
+                for (err, msg) in errors:
+                    if err in ('ERROR', 'MISSING'):
+                        prred(err)
+                    else:
+                        prpurple(err)
+                    print(':', msg)
         except KeyboardInterrupt:
             # if we get interrupted between directories, we still want output
             pass
@@ -4517,11 +4539,16 @@ def main(argv):
         print(file=sys.stderr, end='', flush=True)
         if not testweb and (verbosity == 0 or verbosity == 1):
             if Failed or errseen:
-                prred('ERROR')
+                if verbosity != 0:
+                    prred('ERROR')
             else:
                 prgreen('OK')
             print()
-            print(f'failed={Failed}, skipped={len(Failure[F_SKIP])}')
+            if Failed:
+                prred('failed')
+            else:
+                print('failed', end='')
+            print(f'={Failed}, skipped={len(Failure[F_SKIP])}')
             if produce_html and (Failed or errseen):
                 f = os.path.join(TSTTRGBASE, TSTPREF, "index.html")
                 if sys.version_info[1] >= 14:
diff --git a/tools/mserver/mserver5.c b/tools/mserver/mserver5.c
--- a/tools/mserver/mserver5.c
+++ b/tools/mserver/mserver5.c
@@ -236,9 +236,16 @@ static volatile sig_atomic_t usr1_interr
 static volatile sig_atomic_t usr2_interrupted = 0;
 
 static void
+handler_usr1(int sig)
+{
+       (void) sig;
+       usr1_interrupted = 1;
+}
+
+static void
 usr1trigger(void)
 {
-       usr1_interrupted = 1;
+       handler_usr1(0);
        MT_sleep_ms(150); /* sleep slightly longer than delay for handling usr1 
*/
 }
 
@@ -258,12 +265,6 @@ handler(int sig)
        interrupted = 1;
 }
 static void
-handler_usr1(int sig)
-{
-       (void) sig;
-       usr1trigger();
-}
-static void
 handler_usr2(int sig)
 {
        (void) sig;
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to