diff stream_js.t @ 1247:edf5a3c9e36a

Tests: added tests for js backtraces.
author Dmitry Volyntsev <xeioex@nginx.com>
date Mon, 20 Nov 2017 20:23:24 +0300
parents 4a825ec85c8d
children 70192b1baf01
line wrap: on
line diff
--- a/stream_js.t
+++ b/stream_js.t
@@ -103,6 +103,12 @@ stream {
         js_filter   js_filter_step;
         proxy_pass  127.0.0.1:8090;
     }
+
+    server {
+        listen      127.0.0.1:8092;
+        js_filter   js_filter_except;
+        proxy_pass  127.0.0.1:8090;
+    }
 }
 
 EOF
@@ -174,10 +180,15 @@ EOF
         }
         res += '3';
     }
+
+    function js_filter_except(sess) {
+        sess.a.a;
+    }
+
 EOF
 
 $t->run_daemon(\&stream_daemon, port(8090));
-$t->try_run('no stream njs available')->plan(12);
+$t->try_run('no stream njs available')->plan(13);
 $t->waitforsocket('127.0.0.1:' . port(8090));
 
 ###############################################################################
@@ -196,10 +207,13 @@ is(stream('127.0.0.1:' . port(8087))->re
 is(stream('127.0.0.1:' . port(8088))->io('xyz'), 'xyz', 'js_preread');
 is(stream('127.0.0.1:' . port(8089))->io('x'), 'z', 'js_filter');
 is(stream('127.0.0.1:' . port(8091))->io('0'), '01233', 'handlers order');
+stream('127.0.0.1:' . port(8092))->io('x');
 
 $t->stop();
 
 ok(index($t->read_file('error.log'), 'SEE-THIS') > 0, 'stream js log');
+ok(index($t->read_file('error.log'), 'at js_filter_except') > 0,
+   'stream js_filter backtrace');
 
 ###############################################################################