Changeset: c98841379e12 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=c98841379e12
Added Files:
        sql/test/configurable_rss/Tests/cap_rss_32.py
        sql/test/configurable_rss/Tests/cap_rss_64.py
        sql/test/configurable_rss/Tests/no_cap_rss_32.sql
        sql/test/configurable_rss/Tests/no_cap_rss_64.sql.src
        sql/test/configurable_rss/Tests/push_and_check_rss_32.sql
Modified Files:
        sql/test/configurable_rss/Tests/All
        sql/test/configurable_rss/Tests/cap_rss.py
Branch: config_rss
Log Message:

Specialize tests for 32 and 64 bits environments.


diffs (132 lines):

diff --git a/sql/test/configurable_rss/Tests/All 
b/sql/test/configurable_rss/Tests/All
--- a/sql/test/configurable_rss/Tests/All
+++ b/sql/test/configurable_rss/Tests/All
@@ -1,2 +1,4 @@
-NATIVE_WIN32?cap_rss
-NATIVE_WIN32?no_cap_rss
+BITS64?NATIVE_WIN32?cap_rss_64
+BITS64?NATIVE_WIN32?no_cap_rss_64
+BITS32?NATIVE_WIN32?cap_rss_32
+BITS32?NATIVE_WIN32?no_cap_rss_32
diff --git a/sql/test/configurable_rss/Tests/cap_rss.py 
b/sql/test/configurable_rss/Tests/cap_rss.py
--- a/sql/test/configurable_rss/Tests/cap_rss.py
+++ b/sql/test/configurable_rss/Tests/cap_rss.py
@@ -29,5 +29,3 @@ def main():
     out, err = srv.communicate()
     sys.stdout.write(out)
     sys.stderr.write(err)
-
-main()
diff --git a/sql/test/configurable_rss/Tests/cap_rss_32.py 
b/sql/test/configurable_rss/Tests/cap_rss_32.py
new file mode 100644
--- /dev/null
+++ b/sql/test/configurable_rss/Tests/cap_rss_32.py
@@ -0,0 +1,31 @@
+import os, sys
+try:
+    from MonetDBtesting import process
+except ImportError:
+    import process
+
+def server_start(args):
+    sys.stderr.write('#mserver: "%s"\n' % ' '.join(args))
+    sys.stderr.flush()
+    srv = process.server(args = args, stdin = process.PIPE,
+                         stdout = process.PIPE, stderr = process.PIPE)
+    return srv
+
+def client(lang, file):
+    sys.stderr.write('#client: "%s"\n' % file)
+    sys.stderr.flush()
+    clt = process.client(lang.lower(), stdin = open(file),
+                         stdout = process.PIPE, stderr = process.PIPE)
+    return clt.communicate()
+
+def main():
+    srv = server_start(["--set", "gdk_mem_maxsize=20000000"])
+
+    out, err = client('SQL',
+                      os.path.join(os.getenv('RELSRCDIR'),
+                                   'push_and_check_rss_32.sql'))
+    sys.stdout.write(out)
+    sys.stderr.write(err)
+    out, err = srv.communicate()
+    sys.stdout.write(out)
+    sys.stderr.write(err)
diff --git a/sql/test/configurable_rss/Tests/cap_rss_64.py 
b/sql/test/configurable_rss/Tests/cap_rss_64.py
new file mode 100644
--- /dev/null
+++ b/sql/test/configurable_rss/Tests/cap_rss_64.py
@@ -0,0 +1,4 @@
+import cap_rss
+
+cap_rss.main()
+
diff --git a/sql/test/configurable_rss/Tests/no_cap_rss_32.sql 
b/sql/test/configurable_rss/Tests/no_cap_rss_32.sql
new file mode 100644
--- /dev/null
+++ b/sql/test/configurable_rss/Tests/no_cap_rss_32.sql
@@ -0,0 +1,26 @@
+create function getrss() 
+returns bigint external name status.rss_cursize;
+
+create table test(a int, b int, c double);
+
+insert into test values (1, 0, 1);
+
+create procedure loop_insert(maximum_size bigint)
+begin
+    declare size bigint;
+    set size = (select count(*) from test);
+
+    while size < maximum_size do
+        insert into test (select a+1, b+2, rand()*c from test);
+
+        set size = (select count(*) from test);
+    end while;
+end;
+
+call loop_insert(1000000);
+
+-- it seems that it requires an analytical query to keep memory in ram.
+select getrss() as resident_set_size, quantile(c/a, 0.8) * 0 from test;
+
+drop table test cascade;
+drop function getrss;
diff --git a/sql/test/configurable_rss/Tests/no_cap_rss_64.sql.src 
b/sql/test/configurable_rss/Tests/no_cap_rss_64.sql.src
new file mode 100644
--- /dev/null
+++ b/sql/test/configurable_rss/Tests/no_cap_rss_64.sql.src
@@ -0,0 +1,1 @@
+$RELSRCDIR/no_cap_rss.sql
diff --git a/sql/test/configurable_rss/Tests/push_and_check_rss_32.sql 
b/sql/test/configurable_rss/Tests/push_and_check_rss_32.sql
new file mode 100644
--- /dev/null
+++ b/sql/test/configurable_rss/Tests/push_and_check_rss_32.sql
@@ -0,0 +1,26 @@
+create function getrss() 
+returns bigint external name status.rss_cursize;
+
+create table test(a int, b int, c double);
+
+insert into test values (1, 0, 1);
+
+create procedure loop_insert(maximum_size bigint)
+begin
+    declare size bigint;
+    set size = (select count(*) from test);
+
+    while size < maximum_size do
+        insert into test (select a+1, b+2, rand()*c from test);
+
+        set size = (select count(*) from test);
+    end while;
+end;
+
+call loop_insert(1000000);
+
+-- it seems that it requires an analytical query to keep memory in ram.
+select getrss() as resident_set_size, quantile(c/a, 0.8) * 0  from test;
+
+drop table test cascade;
+drop function getrss;
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to