rhmessaging commits: r3704 - store/trunk/cpp/tests/cluster.
by rhmessaging-commits@lists.jboss.org
Author: aconway
Date: 2009-11-09 14:51:58 -0500 (Mon, 09 Nov 2009)
New Revision: 3704
Added:
store/trunk/cpp/tests/cluster/cluster_tests_env.sh
store/trunk/cpp/tests/cluster/run_cluster_test
Modified:
store/trunk/cpp/tests/cluster/Makefile.am
store/trunk/cpp/tests/cluster/run_cluster_tests
Log:
Added store recovery tests to cluster_tests
Modified: store/trunk/cpp/tests/cluster/Makefile.am
===================================================================
--- store/trunk/cpp/tests/cluster/Makefile.am 2009-11-09 15:06:39 UTC (rev 3703)
+++ store/trunk/cpp/tests/cluster/Makefile.am 2009-11-09 19:51:58 UTC (rev 3704)
@@ -35,7 +35,7 @@
.valgrind.supp: $(top_srcdir)/tests/.valgrind.supp
cp $^ .
-TESTS = run_cluster_tests
+TESTS = run_cluster_tests run_cluster_test
LONG_TESTS = run_long_cluster_tests
Added: store/trunk/cpp/tests/cluster/cluster_tests_env.sh
===================================================================
--- store/trunk/cpp/tests/cluster/cluster_tests_env.sh (rev 0)
+++ store/trunk/cpp/tests/cluster/cluster_tests_env.sh 2009-11-09 19:51:58 UTC (rev 3704)
@@ -0,0 +1,305 @@
+# Copyright (c) 2008, 2009 Red Hat, Inc.
+#
+# This file is part of the Qpid async store library msgstore.so.
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
+# USA
+#
+# The GNU Lesser General Public License is available in the file COPYING.
+
+
+# --- Function definitions ---
+
+
+func_check_required_env ()
+#-------------------------
+# Check that EITHER:
+# QPID_DIR is set (for running against svn QPID)
+# OR
+# QPID_PREFIX is set (for running against installed QPID
+# Will exit with error code 1 if neither of these is defined.
+# Params: None
+# Returns: 0 if env vars ok, 1 otherwise
+{
+ if test -z "${QPID_DIR}" -a -z "${QPID_PREFIX}"; then
+ # Try to find qpidd in the normal installed location
+ if test -x /usr/sbin/qpidd; then
+ QPID_PREFIX=/usr
+ else
+ echo "ERROR: Could not find installed Qpid"
+ echo "Either of the following must be set in the environment for this script to run:"
+ echo " QPID_DIR for running against a Qpid svn build"
+ echo " QPID_PREFIX for running against an installed Qpid"
+ return 1
+ fi
+ fi
+ return 0
+}
+
+
+func_check_ais ()
+#----------------
+# Check openAIS/corosync is running and user has correct privilages
+# Params: None
+# Returns: 0 if openAIS/corosync is running, 1 otherwise
+{
+ id -nG | grep '\<ais\>' >/dev/null || NOGROUP="You are not a member of the ais group."
+ ps -u root | grep 'aisexec\|corosync' >/dev/null || NOAISEXEC="The aisexec or corosync daemon is not running as root"
+
+ if test -n "$NOGROUP" -o -n "$NOAISEXEC"; then
+ cat <<EOF
+
+ ========== WARNING: NOT RUNNING CLUSTER TESTS ============
+
+ Tests that depend on the openais library (used for clustering)
+ will not be run because:
+
+ $NOGROUP
+ $NOAISEXEC
+
+ ==========================================================
+
+EOF
+ return 1
+ fi
+ return 0
+}
+
+
+func_check_qpid_python ()
+#------------------------
+# Check that Qpid python environment is ok
+# Params: None
+# Returns: 0 if Python environment is ok; 1 otherwise
+{
+ if ! python -c "import qpid" ; then
+ cat <<EOF
+
+ =========== WARNING: PYTHON TESTS DISABLED ==============
+
+ Unable to load python qpid module - skipping python tests.
+
+ PYTHONPATH=${PYTHONPATH}
+
+ ===========================================================
+
+EOF
+ return 1
+ fi
+ return 0
+}
+
+func_set_env ()
+#--------------
+# Set up the environment based on value of ${QPID_DIR}: if ${QPID_DIR} exists, assume a svn checkout,
+# otherwise set up for an installed or prefix test.
+# Params: None
+# Returns: Nothing
+{
+ if test "${QPID_DIR}" -a -d "${QPID_DIR}" ; then
+ # QPID_DIR is defined for source tree builds by the --with-qpid-checkout configure option.
+ # QPID_BLD is defined as the build directory, either $QPID_DIR/cpp or separately specified with
+ # the --with-qpid-build option for VPATH builds.
+
+ # Check QPID_BLD is also set
+ if test -z ${QPID_BLD}; then
+ QPID_BLD="${QPID_DIR}/cpp"
+ fi
+
+ # Paths and dirs
+ PYTHON_DIR="${QPID_DIR}/python"
+ export PYTHONPATH="${PYTHON_DIR}":"${QPID_DIR}/cpp/src/tests":"${abs_srcdir}"
+
+ # Libraries
+ export CLUSTER_LIB="${QPID_BLD}/src/.libs/cluster.so"
+ export ACL_LIB="${QPID_BLD}/src/.libs/acl.so"
+ export TEST_STORE_LIB="${QPID_BLD}/src/tests/.libs/test_store.so"
+
+ # Executables
+ CPP_CLUSTER_EXEC="${QPID_BLD}/src/tests/cluster_test"
+ PYTHON_CLUSTER_EXEC="${QPID_DIR}/cpp/src/tests/$PYTHON_TESTNAME"
+ export QPIDD_EXEC="${QPID_BLD}/src/qpidd"
+ export QPID_CONFIG_EXEC="${QPID_DIR}/python/commands/qpid-config"
+ export QPID_ROUTE_EXEC="${QPID_DIR}/python/commands/qpid-route"
+ export RECEIVER_EXEC="${QPID_BLD}/src/tests/receiver"
+ export SENDER_EXEC="${QPID_BLD}/src/tests/sender"
+
+ # Test data
+ CLUSTER_TESTS_FAIL="${QPID_DIR}/cpp/src/tests/cluster_tests.fail"
+ else
+ # Set up the environment based on value of ${QPID_PREFIX} for testing against an installed qpid
+ # Alternatively, make sure ${QPID_BIN_DIR}, ${QPID_SBIN_DIR}, ${QPID_LIB_DIR} and ${QPID_LIBEXEC_DIR} are set for
+ # the installed location.
+ if test "${QPID_PREFIX}" -a -d "${QPID_PREFIX}" ; then
+ QPID_BIN_DIR=${QPID_PREFIX}/bin
+ QPID_SBIN_DIR=${QPID_PREFIX}/sbin
+ QPID_LIB_DIR=${QPID_PREFIX}/lib
+ QPID_LIBEXEC_DIR=${QPID_PREFIX}/libexec
+ fi
+
+ # These four env vars must be set prior to calling this script
+ func_checkpaths QPID_BIN_DIR QPID_SBIN_DIR QPID_LIB_DIR QPID_LIBEXEC_DIR
+
+ # Paths and dirs
+ export PYTHON_DIR="${QPID_BIN_DIR}"
+ export PYTHONPATH="${PYTHONPATH}":"${QPID_LIB_DIR}/python":"${QPID_LIBEXEC_DIR}/qpid/tests":"${QPID_LIB_DIR}/python2.4"
+
+
+ # Libraries
+ export CLUSTER_LIB="${QPID_LIB_DIR}/qpid/daemon/cluster.so"
+ export ACL_LIB="${QPID_LIB_DIR}/qpid/daemon/acl.so"
+ export TEST_STORE_LIB="${QPID_LIB_DIR}/qpid/tests/test_store.so"
+
+ # Executables
+ CPP_CLUSTER_EXEC="${QPID_LIBEXEC_DIR}/qpid/tests/cluster_test"
+ PYTHON_CLUSTER_EXEC="${QPID_LIBEXEC_DIR}/qpid/tests/$PYTHON_TESTNAME"
+ export QPIDD_EXEC="${QPID_SBIN_DIR}/qpidd"
+ export QPID_CONFIG_EXEC="${QPID_BIN_DIR}/qpid-config"
+ export QPID_ROUTE_EXEC="${QPID_BIN_DIR}/qpid-route"
+ export RECEIVER_EXEC="${QPID_LIBEXEC_DIR}/qpid/tests/receiver"
+ export SENDER_EXEC="${QPID_LIBEXEC_DIR}/qpid/tests/sender"
+
+ # Data
+ CLUSTER_TESTS_FAIL="${QPID_LIBEXEC_DIR}/qpid/tests/cluster_tests.fail"
+ fi
+
+}
+
+
+func_mk_data_dir ()
+#------------------
+# Create a data dir at ${TMP_DATA_DIR} if not present, clear it otherwise.
+# Set TMP_DATA_DIR if it is not set.
+# Params: None
+# Returns: Nothing
+{
+ if test -z "${TMP_DATA_DIR}"; then
+ TMP_DATA_DIR=/tmp/cluster_tests
+ echo "TMP_DATA_DIR not set; using ${TMP_DATA_DIR}"
+ fi
+
+ # Delete old cluster test dirs if they exist
+ if test -d "${TMP_DATA_DIR}" ; then
+ rm -rf "${TMP_DATA_DIR}/cluster"
+ fi
+ mkdir -p "${TMP_DATA_DIR}/cluster"
+ export TMP_DATA_DIR
+}
+
+
+func_checkvar ()
+#---------------
+# Check that an environment var is set (ie non-zero length)
+# Params: $1 - env var to be checked
+# Returns: 0 = env var is set (ie non-zero length)
+# 1 = env var is not set
+{
+ local loc_VAR=$1
+ if test -z ${!loc_VAR}; then
+ echo "WARNING: environment variable ${loc_VAR} not set."
+ return 1
+ fi
+ return 0
+}
+
+
+func_checkpaths ()
+#-----------------
+# Check a list of paths (each can contain ':'-separated sub-list) is set and valid (ie each path exists as a dir)
+# Params: $@ - List of path env vars to be checked
+# Returns: Nothing
+{
+ local loc_PATHS=$@
+ for path in ${loc_PATHS}; do
+ func_checkvar ${path}
+ if test $? == 0; then
+ local temp_IFS=${IFS}
+ IFS=":"
+ local pl=${!path}
+ for p in ${pl[@]}; do
+ if test ! -d ${p}; then
+ echo "WARNING: Directory ${p} in var ${path} not found."
+ fi
+ done
+ IFS=${temp_IFS}
+ fi
+ done
+}
+
+
+func_checklibs ()
+#----------------
+# Check that a list of libs is set and valid (ie each lib exists as an executable file)
+# Params: $@ - List of lib values to be checked
+# Returns: Nothing
+{
+ local loc_LIBS=$@
+ for lib in ${loc_LIBS[@]}; do
+ func_checkvar ${lib}
+ if test $? == 0; then
+ if test ! -x ${!lib}; then
+ echo "WARNING: Library ${lib}=${!lib} not found."
+ fi
+ fi
+ done
+}
+
+
+func_checkexecs ()
+#-----------------
+# Check that a list of executable is set and valid (ie each exec exists as an executable file)
+# Params: $@ - List of exec values to be checked
+# Returns: Nothing
+{
+ local loc_EXECS=$@
+ for exec in ${loc_EXECS[@]}; do
+ func_checkvar ${exec}
+ if test $? == 0; then
+ if test ! -x ${!exec}; then
+ echo "WARNING: Executable ${exec}=${!exec} not found or is not executable."
+ fi
+ fi
+ done
+}
+
+
+#--- Start of script ---
+
+func_check_required_env || exit 1 # Cannot run, exit with error
+func_check_ais || exit 0 # A warning, not a failure.
+
+srcdir=`dirname $0`
+if test -z ${abs_srcdir}; then
+ abs_srcdir=${srcdir}
+fi
+export STORE_LIB="${abs_srcdir}/../../lib/.libs/msgstore.so"
+
+PYTHON_TESTNAME=cluster_tests.py
+func_set_env
+func_mk_data_dir
+
+# Check expected environment vars are set
+func_checkpaths PYTHON_DIR PYTHONPATH TMP_DATA_DIR
+func_checklibs CLUSTER_LIB TEST_STORE_LIB STORE_LIB STORE_LIB
+func_checkexecs CPP_CLUSTER_EXEC PYTHON_CLUSTER_EXEC QPIDD_EXEC QPID_CONFIG_EXEC QPID_ROUTE_EXEC RECEIVER_EXEC SENDER_EXEC
+
+FAILING_PYTHON_TESTS="${abs_srcdir}/../failing_python_tests.txt"
+if test -z $1; then
+ CLUSTER_TEST="${PYTHON_DIR}/qpid-python-test -m cluster_tests -I ${CLUSTER_TESTS_FAIL}"
+else
+ CLUSTER_TEST="${PYTHON_DIR}/qpid-python-test -m cluster_tests -I ${CLUSTER_TESTS_FAIL} cluster_tests.LongTests.*"
+ LONG_TEST=1
+fi
+
Property changes on: store/trunk/cpp/tests/cluster/cluster_tests_env.sh
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:eol-style
+ native
Added: store/trunk/cpp/tests/cluster/run_cluster_test
===================================================================
--- store/trunk/cpp/tests/cluster/run_cluster_test (rev 0)
+++ store/trunk/cpp/tests/cluster/run_cluster_test 2009-11-09 19:51:58 UTC (rev 3704)
@@ -0,0 +1,37 @@
+#!/bin/bash
+
+# Copyright (c) 2008, 2009 Red Hat, Inc.
+#
+# This file is part of the Qpid async store library msgstore.so.
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
+# USA
+#
+# The GNU Lesser General Public License is available in the file COPYING.
+
+. `dirname $0`/cluster_tests_env.sh
+
+
+
+# Run the C++ cluster tests (which are by definition short tests)
+if test ! ${LONG_TEST} ; then
+ echo "Running C++ cluster tests..."
+ sg ais -c "${CPP_CLUSTER_EXEC}"
+ RETCODE=$?
+ if test x${RETCODE} != x0; then
+ exit 1;
+ fi
+fi
+exit 0
Property changes on: store/trunk/cpp/tests/cluster/run_cluster_test
___________________________________________________________________
Name: svn:executable
+ *
Modified: store/trunk/cpp/tests/cluster/run_cluster_tests
===================================================================
--- store/trunk/cpp/tests/cluster/run_cluster_tests 2009-11-09 15:06:39 UTC (rev 3703)
+++ store/trunk/cpp/tests/cluster/run_cluster_tests 2009-11-09 19:51:58 UTC (rev 3704)
@@ -21,302 +21,24 @@
#
# The GNU Lesser General Public License is available in the file COPYING.
+. `dirname $0`/cluster_tests_env.sh
-# --- Function definitions ---
-
-func_check_required_env ()
-#-------------------------
-# Check that EITHER:
-# QPID_DIR is set (for running against svn QPID)
-# OR
-# QPID_PREFIX is set (for running against installed QPID
-# Will exit with error code 1 if neither of these is defined.
-# Params: None
-# Returns: 0 if env vars ok, 1 otherwise
-{
- if test -z "${QPID_DIR}" -a -z "${QPID_PREFIX}"; then
- # Try to find qpidd in the normal installed location
- if test -x /usr/sbin/qpidd; then
- QPID_PREFIX=/usr
- else
- echo "ERROR: Could not find installed Qpid"
- echo "Either of the following must be set in the environment for this script to run:"
- echo " QPID_DIR for running against a Qpid svn build"
- echo " QPID_PREFIX for running against an installed Qpid"
- return 1
- fi
- fi
- return 0
-}
-
-
-func_check_ais ()
-#----------------
-# Check openAIS/corosync is running and user has correct privilages
-# Params: None
-# Returns: 0 if openAIS/corosync is running, 1 otherwise
-{
- id -nG | grep '\<ais\>' >/dev/null || NOGROUP="You are not a member of the ais group."
- ps -u root | grep 'aisexec\|corosync' >/dev/null || NOAISEXEC="The aisexec or corosync daemon is not running as root"
-
- if test -n "$NOGROUP" -o -n "$NOAISEXEC"; then
- cat <<EOF
-
- ========== WARNING: NOT RUNNING CLUSTER TESTS ============
-
- Tests that depend on the openais library (used for clustering)
- will not be run because:
-
- $NOGROUP
- $NOAISEXEC
-
- ==========================================================
-
-EOF
- return 1
- fi
- return 0
-}
-
-
-func_check_qpid_python ()
-#------------------------
-# Check that Qpid python environment is ok
-# Params: None
-# Returns: 0 if Python environment is ok; 1 otherwise
-{
- if ! python -c "import qpid" ; then
- cat <<EOF
-
- =========== WARNING: PYTHON TESTS DISABLED ==============
-
- Unable to load python qpid module - skipping python tests.
-
- PYTHONPATH=${PYTHONPATH}
-
- ===========================================================
-
-EOF
- return 1
- fi
- return 0
-}
-
-func_set_env ()
-#--------------
-# Set up the environment based on value of ${QPID_DIR}: if ${QPID_DIR} exists, assume a svn checkout,
-# otherwise set up for an installed or prefix test.
-# Params: None
-# Returns: Nothing
-{
- if test "${QPID_DIR}" -a -d "${QPID_DIR}" ; then
- # QPID_DIR is defined for source tree builds by the --with-qpid-checkout configure option.
- # QPID_BLD is defined as the build directory, either $QPID_DIR/cpp or separately specified with
- # the --with-qpid-build option for VPATH builds.
-
- # Check QPID_BLD is also set
- if test -z ${QPID_BLD}; then
- QPID_BLD="${QPID_DIR}/cpp"
- fi
-
- # Paths and dirs
- PYTHON_DIR="${QPID_DIR}/python"
- export PYTHONPATH="${PYTHON_DIR}":"${QPID_DIR}/cpp/src/tests":"${abs_srcdir}"
-
- # Libraries
- export CLUSTER_LIB="${QPID_BLD}/src/.libs/cluster.so"
- export ACL_LIB="${QPID_BLD}/src/.libs/acl.so"
- export TEST_STORE_LIB="${QPID_BLD}/src/tests/.libs/test_store.so"
-
- # Executables
- CPP_CLUSTER_EXEC="${QPID_BLD}/src/tests/cluster_test"
- PYTHON_CLUSTER_EXEC="${QPID_DIR}/cpp/src/tests/$PYTHON_TESTNAME"
- export QPIDD_EXEC="${QPID_BLD}/src/qpidd"
- export QPID_CONFIG_EXEC="${QPID_DIR}/python/commands/qpid-config"
- export QPID_ROUTE_EXEC="${QPID_DIR}/python/commands/qpid-route"
- export RECEIVER_EXEC="${QPID_BLD}/src/tests/receiver"
- export SENDER_EXEC="${QPID_BLD}/src/tests/sender"
- else
- # Set up the environment based on value of ${QPID_PREFIX} for testing against an installed qpid
- # Alternatively, make sure ${QPID_BIN_DIR}, ${QPID_SBIN_DIR}, ${QPID_LIB_DIR} and ${QPID_LIBEXEC_DIR} are set for
- # the installed location.
- if test "${QPID_PREFIX}" -a -d "${QPID_PREFIX}" ; then
- QPID_BIN_DIR=${QPID_PREFIX}/bin
- QPID_SBIN_DIR=${QPID_PREFIX}/sbin
- QPID_LIB_DIR=${QPID_PREFIX}/lib
- QPID_LIBEXEC_DIR=${QPID_PREFIX}/libexec
- fi
-
- # These four env vars must be set prior to calling this script
- func_checkpaths QPID_BIN_DIR QPID_SBIN_DIR QPID_LIB_DIR QPID_LIBEXEC_DIR
-
- # Paths and dirs
- export PYTHON_DIR="${QPID_BIN_DIR}"
- export PYTHONPATH="${PYTHONPATH}":"${QPID_LIB_DIR}/python":"${QPID_LIBEXEC_DIR}/qpid/tests":"${QPID_LIB_DIR}/python2.4"
-
-
- # Libraries
- export CLUSTER_LIB="${QPID_LIB_DIR}/qpid/daemon/cluster.so"
- export ACL_LIB="${QPID_LIB_DIR}/qpid/daemon/acl.so"
- export TEST_STORE_LIB="${QPID_LIB_DIR}/qpid/tests/test_store.so"
-
- # Executables
- CPP_CLUSTER_EXEC="${QPID_LIBEXEC_DIR}/qpid/tests/cluster_test"
- PYTHON_CLUSTER_EXEC="${QPID_LIBEXEC_DIR}/qpid/tests/$PYTHON_TESTNAME"
- export QPIDD_EXEC="${QPID_SBIN_DIR}/qpidd"
- export QPID_CONFIG_EXEC="${QPID_BIN_DIR}/qpid-config"
- export QPID_ROUTE_EXEC="${QPID_BIN_DIR}/qpid-route"
- export RECEIVER_EXEC="${QPID_LIBEXEC_DIR}/qpid/tests/receiver"
- export SENDER_EXEC="${QPID_LIBEXEC_DIR}/qpid/tests/sender"
- fi
-}
-
-
-func_mk_data_dir ()
-#------------------
-# Create a data dir at ${TMP_DATA_DIR} if not present, clear it otherwise.
-# Set TMP_DATA_DIR if it is not set.
-# Params: None
-# Returns: Nothing
-{
- if test -z "${TMP_DATA_DIR}"; then
- TMP_DATA_DIR=/tmp/cluster_tests
- echo "TMP_DATA_DIR not set; using ${TMP_DATA_DIR}"
- fi
-
- # Delete old cluster test dirs if they exist
- if test -d "${TMP_DATA_DIR}" ; then
- rm -rf "${TMP_DATA_DIR}/cluster"
- fi
- mkdir -p "${TMP_DATA_DIR}/cluster"
- export TMP_DATA_DIR
-}
-
-
-func_checkvar ()
-#---------------
-# Check that an environment var is set (ie non-zero length)
-# Params: $1 - env var to be checked
-# Returns: 0 = env var is set (ie non-zero length)
-# 1 = env var is not set
-{
- local loc_VAR=$1
- if test -z ${!loc_VAR}; then
- echo "WARNING: environment variable ${loc_VAR} not set."
- return 1
- fi
- return 0
-}
-
-
-func_checkpaths ()
-#-----------------
-# Check a list of paths (each can contain ':'-separated sub-list) is set and valid (ie each path exists as a dir)
-# Params: $@ - List of path env vars to be checked
-# Returns: Nothing
-{
- local loc_PATHS=$@
- for path in ${loc_PATHS}; do
- func_checkvar ${path}
- if test $? == 0; then
- local temp_IFS=${IFS}
- IFS=":"
- local pl=${!path}
- for p in ${pl[@]}; do
- if test ! -d ${p}; then
- echo "WARNING: Directory ${p} in var ${path} not found."
- fi
- done
- IFS=${temp_IFS}
- fi
- done
-}
-
-
-func_checklibs ()
-#----------------
-# Check that a list of libs is set and valid (ie each lib exists as an executable file)
-# Params: $@ - List of lib values to be checked
-# Returns: Nothing
-{
- local loc_LIBS=$@
- for lib in ${loc_LIBS[@]}; do
- func_checkvar ${lib}
- if test $? == 0; then
- if test ! -x ${!lib}; then
- echo "WARNING: Library ${lib}=${!lib} not found."
- fi
- fi
- done
-}
-
-
-func_checkexecs ()
-#-----------------
-# Check that a list of executable is set and valid (ie each exec exists as an executable file)
-# Params: $@ - List of exec values to be checked
-# Returns: Nothing
-{
- local loc_EXECS=$@
- for exec in ${loc_EXECS[@]}; do
- func_checkvar ${exec}
- if test $? == 0; then
- if test ! -x ${!exec}; then
- echo "WARNING: Executable ${exec}=${!exec} not found or is not executable."
- fi
- fi
- done
-}
-
-
-#--- Start of script ---
-
-func_check_required_env || exit 1 # Cannot run, exit with error
-func_check_ais || exit 0 # A warning, not a failure.
-
-srcdir=`dirname $0`
-if test -z ${abs_srcdir}; then
- abs_srcdir=${srcdir}
-fi
-export STORE_LIB="${abs_srcdir}/../../lib/.libs/msgstore.so"
-
-PYTHON_TESTNAME=cluster_tests.py
-func_set_env
-func_mk_data_dir
-
-# Check expected environment vars are set
-func_checkpaths PYTHON_DIR PYTHONPATH TMP_DATA_DIR
-func_checklibs CLUSTER_LIB TEST_STORE_LIB STORE_LIB STORE_LIB
-func_checkexecs CPP_CLUSTER_EXEC PYTHON_CLUSTER_EXEC QPIDD_EXEC QPID_CONFIG_EXEC QPID_ROUTE_EXEC RECEIVER_EXEC SENDER_EXEC
-
-FAILING_PYTHON_TESTS="${abs_srcdir}/../failing_python_tests.txt"
-if test -z $1; then
- CLUSTER_TEST="${PYTHON_DIR}/qpid-python-test -m cluster_tests -I ${FAILING_PYTHON_TESTS} cluster_tests.ShortTests.*"
-else
- CLUSTER_TEST="${PYTHON_DIR}/qpid-python-test -m cluster_tests -I ${FAILING_PYTHON_TESTS} cluster_tests.LongTests.*"
- LONG_TEST=1
-fi
-
-# Run the C++ cluster tests (which are by definition short tests)
-if test ! ${LONG_TEST}; then
- echo "Running C++ cluster tests..."
- sg ais -c "${CPP_CLUSTER_EXEC}"
- RETCODE=$?
- if test x${RETCODE} != x0; then
- exit 1;
- fi
-fi
-
func_check_qpid_python || exit 0 # A warning, not a failure.
echo "Running Python cluster tests..."
+OUTDIR=brokertest.tmp
+rm -rf $OUTDIR
+CLUSTER_TEST="${PYTHON_DIR}/qpid-python-test -m cluster_tests -I ${CLUSTER_TESTS_FAIL} -DOUTDIR=$OUTDIR"
+
+
sg ais -c "${CLUSTER_TEST}"
RETCODE=$?
if test x${RETCODE} != x0; then
exit 1;
fi
+rm -rf $OUTDIR
../clean.sh
15 years, 4 months
rhmessaging commits: r3703 - in store/trunk/cpp: lib and 1 other directories.
by rhmessaging-commits@lists.jboss.org
Author: kpvdr
Date: 2009-11-09 10:06:39 -0500 (Mon, 09 Nov 2009)
New Revision: 3703
Modified:
store/trunk/cpp/Makefile.am
store/trunk/cpp/lib/MessageStoreImpl.cpp
store/trunk/cpp/tests/Makefile.am
store/trunk/cpp/tests/SimpleTest.cpp
store/trunk/cpp/tests/TransactionalTest.cpp
Log:
Minor corrections and additions to store makefiles and tests
Modified: store/trunk/cpp/Makefile.am
===================================================================
--- store/trunk/cpp/Makefile.am 2009-11-09 15:05:16 UTC (rev 3702)
+++ store/trunk/cpp/Makefile.am 2009-11-09 15:06:39 UTC (rev 3703)
@@ -56,9 +56,9 @@
@echo "WARNING: rpmlint not found, could not validate RPMs."
endif
-check-long:
+check-long: all
$(MAKE) -C tests check-long
-check-short:
+check-short: all
$(MAKE) -C tests check-short
Modified: store/trunk/cpp/lib/MessageStoreImpl.cpp
===================================================================
--- store/trunk/cpp/lib/MessageStoreImpl.cpp 2009-11-09 15:05:16 UTC (rev 3702)
+++ store/trunk/cpp/lib/MessageStoreImpl.cpp 2009-11-09 15:06:39 UTC (rev 3703)
@@ -288,7 +288,7 @@
else
init();
- QPID_LOG(notice, "Store module initialized; dir=" << dir);
+ QPID_LOG(notice, "Store module initialized; store-dir=" << dir);
QPID_LOG(info, "> Default files per journal: " << jfiles);
// TODO: Uncomment these lines when auto-expand is enabled.
// QPID_LOG(info, "> Auto-expand " << (autoJrnlExpand ? "enabled" : "disabled"));
Modified: store/trunk/cpp/tests/Makefile.am
===================================================================
--- store/trunk/cpp/tests/Makefile.am 2009-11-09 15:05:16 UTC (rev 3702)
+++ store/trunk/cpp/tests/Makefile.am 2009-11-09 15:06:39 UTC (rev 3703)
@@ -43,11 +43,11 @@
system_test.sh \
clean.sh
-LONG_TESTS = \
- run_long_python_tests \
+LONG_TESTS = \
+ run_long_python_tests \
clean.sh
-SHORT_TESTS = \
+SHORT_TESTS = \
SimpleTest \
TransactionalTest \
system_test.sh \
@@ -99,13 +99,13 @@
$(srcdir)/run_test
# Note: Auto-recursion is not supported for custom targets, so add a ${MAKE} -C for each dir in the SUBDIRS list above.
-check-long:
+check-long: all
$(MAKE) -C jrnl check-long
if DO_CLUSTER_TESTS
$(MAKE) -C cluster check-long
endif
$(MAKE) check TESTS="$(LONG_TESTS)" SUBDIRS=.
-check-short:
+check-short: all
$(MAKE) check TESTS="$(SHORT_TESTS)" SUBDIRS=.
\ No newline at end of file
Modified: store/trunk/cpp/tests/SimpleTest.cpp
===================================================================
--- store/trunk/cpp/tests/SimpleTest.cpp 2009-11-09 15:05:16 UTC (rev 3702)
+++ store/trunk/cpp/tests/SimpleTest.cpp 2009-11-09 15:06:39 UTC (rev 3703)
@@ -112,6 +112,10 @@
Exchange::shared_ptr exchange = exchanges.get(exchangeName);
Queue::shared_ptr queue = queues.find(queueName);
+ // check exchange args are still set
+ for (FieldTable::ValueMap::const_iterator i = args.begin(); i!=args.end(); i++) {
+ BOOST_CHECK(exchange->getArgs().get((*i).first)->getData() == (*i).second->getData());
+ }
//check it is bound by unbinding
BOOST_REQUIRE(exchange->unbind(queue, key, &args));
store.unbind(*exchange, *queue, key, args);
@@ -127,6 +131,10 @@
Exchange::shared_ptr exchange = exchanges.get(exchangeName);
Queue::shared_ptr queue = queues.find(queueName);
+ // check exchange args are still set
+ for (FieldTable::ValueMap::const_iterator i = args.begin(); i!=args.end(); i++) {
+ BOOST_CHECK(exchange->getArgs().get((*i).first)->getData() == (*i).second->getData());
+ }
//make sure it is no longer bound
BOOST_REQUIRE(!exchange->unbind(queue, key, &args));
}
Modified: store/trunk/cpp/tests/TransactionalTest.cpp
===================================================================
--- store/trunk/cpp/tests/TransactionalTest.cpp 2009-11-09 15:05:16 UTC (rev 3702)
+++ store/trunk/cpp/tests/TransactionalTest.cpp 2009-11-09 15:06:39 UTC (rev 3703)
@@ -266,7 +266,7 @@
QPID_AUTO_TEST_CASE(MultiQueueAbort)
{
cout << test_filename << ".MultiQueueAbort: " << flush;
- testMultiQueueTxn(2, true, true);
+ testMultiQueueTxn(2, true, false);
cout << "ok" << endl;
}
15 years, 4 months
rhmessaging commits: r3702 - mgmt/trunk/wooly/python/wooly.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2009-11-09 10:05:16 -0500 (Mon, 09 Nov 2009)
New Revision: 3702
Modified:
mgmt/trunk/wooly/python/wooly/__init__.py
mgmt/trunk/wooly/python/wooly/bench.py
Log:
* Print min/max/average page load times in cumin-bench
* Optimize query var look up when marshalling session state
Modified: mgmt/trunk/wooly/python/wooly/__init__.py
===================================================================
--- mgmt/trunk/wooly/python/wooly/__init__.py 2009-11-05 18:18:42 UTC (rev 3701)
+++ mgmt/trunk/wooly/python/wooly/__init__.py 2009-11-09 15:05:16 UTC (rev 3702)
@@ -10,7 +10,7 @@
from time import gmtime
from uuid import uuid4
-from profile import *
+from wooly.profile import *
from resources import ResourceFinder, StringCatalog
from util import *
@@ -541,7 +541,6 @@
def expire_cookie(self, name):
self.set_cookie(name, "", datetime(*gmtime(1)[0:6]))
- # This is the biggest hotspot in cumin-bench profiling
def get(self, key):
if key in self.values_by_path:
value = self.values_by_path[key]
@@ -583,37 +582,34 @@
params = self.page.get_page_parameters(self)
vars = list()
+ values_by_path = self.gather_values()
+
for param in params:
key = param.path
+ value = values_by_path.get(key)
- if param.is_collection:
- collection = self.get(key)
-
- if collection:
- for value in collection:
- svalue = quote(param.marshal(value))
- vars.append("%s=%s" % (key, svalue))
- else:
- #value = self.get(key)
-
- # Inlined below saving about a second in a
- # 1000-hit profile
-
- if key in self.values_by_path:
- value = self.values_by_path[key]
- elif self.trunk:
- value = self.trunk.get(key)
- else:
- value = None
-
- default = param.get_default(self)
-
- if value not in (default, None):
+ if value is not None:
+ if param.is_collection:
+ for item in value:
+ sitem = quote(param.marshal(item))
+ vars.append("%s=%s" % (key, sitem))
+ elif value != param.get_default(self):
svalue = quote(param.marshal(value))
vars.append("%s=%s" % (key, svalue))
return separator.join(vars)
+ def gather_values(self):
+ if self.trunk is None:
+ return self.values_by_path
+ else:
+ values_by_path = dict()
+
+ values_by_path.update(self.trunk.gather_values())
+ values_by_path.update(self.values_by_path)
+
+ return values_by_path
+
def unmarshal(cls, app, string):
elems = string.split("?")
Modified: mgmt/trunk/wooly/python/wooly/bench.py
===================================================================
--- mgmt/trunk/wooly/python/wooly/bench.py 2009-11-05 18:18:42 UTC (rev 3701)
+++ mgmt/trunk/wooly/python/wooly/bench.py 2009-11-09 15:05:16 UTC (rev 3702)
@@ -75,9 +75,10 @@
print "-" * 80
- def run(self, max=-1):
+ def run(self, max_count=-1):
urls = list()
visited = set()
+ times = list()
count = 1
referer = None
@@ -92,11 +93,15 @@
html, profile = self.visit(url, referer, 0)
+ end = time()
+
bytes = len(html)
- millis = (time() - start) * 1000
+ millis = (end - start) * 1000
print "%i [%i bytes, %i millis]" % (count, bytes, millis)
+ times.append(millis)
+
profile.print_process_render_asymmetry()
#profile.compute_times()
@@ -104,7 +109,7 @@
#profile.print_process_calls()
#profile.print_render_calls()
- if count == max:
+ if count == max_count:
break
count += 1
@@ -120,6 +125,10 @@
self.print_profile()
+ args = (min(times), max(times), sum(times) / float(len(times)))
+
+ print "[min %.3f, max %.3f, avg %.3f]" % args
+
def print_profile(self):
render_times_by_widget = defaultdict(list)
15 years, 4 months
rhmessaging commits: r3701 - store/trunk/cpp/lib.
by rhmessaging-commits@lists.jboss.org
Author: kpvdr
Date: 2009-11-05 13:18:42 -0500 (Thu, 05 Nov 2009)
New Revision: 3701
Modified:
store/trunk/cpp/lib/MessageStoreImpl.cpp
store/trunk/cpp/lib/MessageStoreImpl.h
Log:
Fix for Bug 533169 - "clustered qpidd run as service (configured in /etc/qpidd.conf) causes delete of /var/lib/qpidd/qpidd.sasldb"
Modified: store/trunk/cpp/lib/MessageStoreImpl.cpp
===================================================================
--- store/trunk/cpp/lib/MessageStoreImpl.cpp 2009-11-04 22:20:31 UTC (rev 3700)
+++ store/trunk/cpp/lib/MessageStoreImpl.cpp 2009-11-05 18:18:42 UTC (rev 3701)
@@ -373,9 +373,9 @@
}
}
-void MessageStoreImpl::pushDown(const char* dirName, const char* bakDirName)
+void MessageStoreImpl::pushDown(const std::string& dirName, const std::string& targetDir, const std::string& bakDirName)
{
- DIR* dir = ::opendir(dirName);
+ DIR* dir = ::opendir(dirName.c_str());
if (dir)
{
std::ostringstream oss;
@@ -385,15 +385,15 @@
// Create new bak dir
mrg::journal::jdir::create_dir(oss.str());
- // Copy contents of current dir into bak dir
+ // Copy contents of targetDir into bak dir
struct dirent* entry;
while ((entry = ::readdir(dir)) != 0) {
- // Ignore . and .. and backup dir
- if (std::strcmp(entry->d_name, ".") != 0 && std::strcmp(entry->d_name, "..") != 0 && std::strcmp(entry->d_name, bakDirName)) {
+ // Search for targetDir in dirName
+ if (std::strcmp(entry->d_name, targetDir.c_str()) == 0) {
std::ostringstream oldname;
- oldname << dirName << "/" << entry->d_name;
+ oldname << dirName << "/" << targetDir;
std::ostringstream newname;
- newname << oss.str() << "/" << entry->d_name;
+ newname << oss.str() << "/" << targetDir;
::rename(oldname.str().c_str(), newname.str().c_str());
}
}
@@ -416,11 +416,11 @@
dbenv->close(0);
}
if (pushDownStoreFiles)
- pushDown(storeDir.c_str(), "cluster_bak");
+ pushDown(storeDir, storeTopLevelDir, "cluster_bak");
else {
- QPID_LOG(notice, "Store in " << storeDir << " truncated.");
std::ostringstream oss;
oss << storeDir << "/" << storeTopLevelDir;
+ QPID_LOG(notice, "Store in " << oss.str() << " truncated.");
mrg::journal::jdir::delete_dir(oss.str().c_str());
}
init();
Modified: store/trunk/cpp/lib/MessageStoreImpl.h
===================================================================
--- store/trunk/cpp/lib/MessageStoreImpl.h 2009-11-04 22:20:31 UTC (rev 3700)
+++ store/trunk/cpp/lib/MessageStoreImpl.h 2009-11-05 18:18:42 UTC (rev 3701)
@@ -169,7 +169,7 @@
void init();
- void pushDown(const char* dir, const char* bakDirName = "bak");
+ void pushDown(const std::string& dir, const std::string& targetDir, const std::string& bakDirName = "bak");
void recoverQueues(TxnCtxt& txn,
qpid::broker::RecoveryManager& recovery,
15 years, 4 months
rhmessaging commits: r3700 - mgmt/trunk/wooly/python/wooly.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2009-11-04 17:20:31 -0500 (Wed, 04 Nov 2009)
New Revision: 3700
Modified:
mgmt/trunk/wooly/python/wooly/server.py
Log:
Restored ability to send cookies to browser.
Modified: mgmt/trunk/wooly/python/wooly/server.py
===================================================================
--- mgmt/trunk/wooly/python/wooly/server.py 2009-11-04 20:21:32 UTC (rev 3699)
+++ mgmt/trunk/wooly/python/wooly/server.py 2009-11-04 22:20:31 UTC (rev 3700)
@@ -161,6 +161,9 @@
if cache:
headers.append(("Cache-Control", cache))
+ for header in session.marshal_cookies():
+ headers.append(("Set-Cookie", header))
+
def send_not_found(self, response, headers):
message = "404 Not Found"
15 years, 4 months
rhmessaging commits: r3699 - mgmt/trunk/wooly/python/wooly.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2009-11-04 15:21:32 -0500 (Wed, 04 Nov 2009)
New Revision: 3699
Modified:
mgmt/trunk/wooly/python/wooly/bench.py
Log:
Modify cumin-bench output; restore xml checking
Modified: mgmt/trunk/wooly/python/wooly/bench.py
===================================================================
--- mgmt/trunk/wooly/python/wooly/bench.py 2009-11-04 19:24:20 UTC (rev 3698)
+++ mgmt/trunk/wooly/python/wooly/bench.py 2009-11-04 20:21:32 UTC (rev 3699)
@@ -4,6 +4,7 @@
from collections import defaultdict
from traceback import print_exc
from time import time
+from xml.parsers.expat import ParserCreate
from wooly import Session, ClientSession
@@ -40,15 +41,20 @@
return self.visit(redirect, url, depth + 1)
html = page.render(session)
+
+ if self.print_output:
+ self.print_output_with_line_numbers(html)
+
+ if self.check_output:
+ parser = ParserCreate()
+ parser.Parse(html)
except KeyboardInterrupt:
raise
except:
- print
print "Page failure"
profile.print_stack_trace()
- print "URL: %s" % url
print "Referer: %s" % referer
if self.continue_on_error:
@@ -59,27 +65,16 @@
return (html, profile)
- def parse_html(self, html):
- try:
- parser = ParserCreate()
- parser.Parse(html)
- except KeyboardInterrupt:
- raise
- except:
- print
+ def print_output_with_line_numbers(self, html):
+ lines = html.split(os.linesep)
- html = html + "[eof]"
+ print "-" * 80
- lines = html.split(os.linesep)
+ for i, line in enumerate(lines):
+ print "%4i %s" % (i + 1, line)
- for i, line in enumerate(lines):
- print "%4i %s" % (i + 1, line)
+ print "-" * 80
- if self.continue_on_error:
- print_exc(file=sys.stderr)
- else:
- raise
-
def run(self, max=-1):
urls = list()
visited = set()
@@ -91,7 +86,7 @@
while url is not None:
visited.add(url)
- print "%4i %-56s" % (count, truncate(url, 56)),
+ print "%i %s" % (count, url)
start = time()
@@ -100,13 +95,8 @@
bytes = len(html)
millis = (time() - start) * 1000
- print "[%5ib, %4ims]" % (bytes, millis)
+ print "%i [%i bytes, %i millis]" % (count, bytes, millis)
- if self.print_output:
- print "-" * 80
- print " %s" % html.replace("\n", "\n ")
- print "-" * 80
-
profile.print_process_render_asymmetry()
#profile.compute_times()
15 years, 4 months
rhmessaging commits: r3698 - store/trunk/cpp/tests/python_tests.
by rhmessaging-commits@lists.jboss.org
Author: kpvdr
Date: 2009-11-04 14:24:20 -0500 (Wed, 04 Nov 2009)
New Revision: 3698
Modified:
store/trunk/cpp/tests/python_tests/flow_to_disk.py
Log:
Fix to flow-to-disk test non-unique XID problem which was causing tests to fail if transactions were left hanging.
Modified: store/trunk/cpp/tests/python_tests/flow_to_disk.py
===================================================================
--- store/trunk/cpp/tests/python_tests/flow_to_disk.py 2009-11-04 18:17:43 UTC (rev 3697)
+++ store/trunk/cpp/tests/python_tests/flow_to_disk.py 2009-11-04 19:24:20 UTC (rev 3698)
@@ -19,7 +19,7 @@
#
# The GNU Lesser General Public License is available in the file COPYING.
-import random, time
+import random, time, uuid
from qpid.client import Client, Closed
from qpid.queue import Empty
from qpid.testlib import TestBase010
@@ -37,7 +37,7 @@
def _browse(self, queueName, destinationTag, acquireMode, numMsgs, msgSize, txnConsume):
txid = None
if txnConsume:
- txid = self._makeXid("consumer-xid-%s" % queueName)
+ txid = self._makeXid()
self.session.dtx_select()
self.assertEqual(self.XA_OK, self.session.dtx_start(xid=txid).status)
self.session.message_subscribe(queue=queueName, destination=destinationTag, acquire_mode=acquireMode)
@@ -93,14 +93,12 @@
msg += chr(ord('a') + (i % 26))
return msg
- def _makeXid(self, txid):
- self.txCounter += 1
- branchqual = "v%s" % self.txCounter
- return self.session.xid(format=0, global_id=txid, branch_id=branchqual)
+ def _makeXid(self):
+ return self.session.xid(format=0, global_id=uuid.uuid4().bytes, branch_id="")
def _produceDirect(self, queueName, deliveryMode, numMsgs, msgSize, txnProduce):
if txnProduce:
- txid = self._makeXid("producer-xid-%s" % queueName)
+ txid = self._makeXid()
self.session.dtx_select()
self.assertEqual(self.XA_OK, self.session.dtx_start(xid=txid).status)
for msgNum in range(0, numMsgs):
@@ -114,7 +112,7 @@
def _produceFanout(self, exchangeName, deliveryMode, numMsgs, msgSize, txnProduce, fail_on_msg):
if txnProduce:
- txid = self._makeXid("producer-xid-%s" % exchangeName)
+ txid = self._makeXid()
self.session.dtx_select()
self.assertEqual(self.XA_OK, self.session.dtx_start(xid=txid).status)
try:
15 years, 4 months
rhmessaging commits: r3697 - mgmt/trunk/cumin/python/cumin/grid.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2009-11-04 13:17:43 -0500 (Wed, 04 Nov 2009)
New Revision: 3697
Modified:
mgmt/trunk/cumin/python/cumin/grid/slot.py
Log:
whitespace
Modified: mgmt/trunk/cumin/python/cumin/grid/slot.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/grid/slot.py 2009-11-04 18:16:16 UTC (rev 3696)
+++ mgmt/trunk/cumin/python/cumin/grid/slot.py 2009-11-04 18:17:43 UTC (rev 3697)
@@ -293,7 +293,7 @@
if level < len(groups):
el.tree = self.treeify(records, level_dict[key], groups, level + 1, leaves)
level_list.append(el)
-
+
return level_list
def get_cached(self, session, zl):
15 years, 4 months
rhmessaging commits: r3696 - mgmt/trunk/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2009-11-04 13:16:16 -0500 (Wed, 04 Nov 2009)
New Revision: 3696
Modified:
mgmt/trunk/cumin/python/cumin/widgets.py
Log:
Avoid exception when main page tabs are clicked after drilling down to a sub-page
Modified: mgmt/trunk/cumin/python/cumin/widgets.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/widgets.py 2009-11-04 17:00:24 UTC (rev 3695)
+++ mgmt/trunk/cumin/python/cumin/widgets.py 2009-11-04 18:16:16 UTC (rev 3696)
@@ -72,6 +72,12 @@
return lsess.marshal()
+ def render_tab_href(self, session, tab):
+ branch = session.branch()
+ tab.mode.set(branch, None)
+ tab.show(branch)
+ return branch.marshal()
+
class CuminPageLinks(ItemSet):
def __init__(self, app, name):
super(CuminPageLinks, self).__init__(app, name)
15 years, 4 months
rhmessaging commits: r3695 - in mgmt/trunk: wooly/python/wooly and 1 other directory.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2009-11-04 12:00:24 -0500 (Wed, 04 Nov 2009)
New Revision: 3695
Modified:
mgmt/trunk/cumin/python/cumin/widgets.py
mgmt/trunk/wooly/python/wooly/bench.py
mgmt/trunk/wooly/python/wooly/profile.py
Log:
Restore detection of process/render asymmetry
Modified: mgmt/trunk/cumin/python/cumin/widgets.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/widgets.py 2009-11-04 16:04:51 UTC (rev 3694)
+++ mgmt/trunk/cumin/python/cumin/widgets.py 2009-11-04 17:00:24 UTC (rev 3695)
@@ -46,6 +46,7 @@
def do_process(self, session, *args):
self.tasks.process(session)
self.heartbeat.process(session)
+ self.links.process(session)
super(CuminMainView, self).do_process(session, *args)
Modified: mgmt/trunk/wooly/python/wooly/bench.py
===================================================================
--- mgmt/trunk/wooly/python/wooly/bench.py 2009-11-04 16:04:51 UTC (rev 3694)
+++ mgmt/trunk/wooly/python/wooly/bench.py 2009-11-04 17:00:24 UTC (rev 3695)
@@ -43,6 +43,7 @@
except KeyboardInterrupt:
raise
except:
+ print
print "Page failure"
profile.print_stack_trace()
@@ -106,6 +107,8 @@
print " %s" % html.replace("\n", "\n ")
print "-" * 80
+ profile.print_process_render_asymmetry()
+
#profile.compute_times()
#profile.print_results()
#profile.print_process_calls()
Modified: mgmt/trunk/wooly/python/wooly/profile.py
===================================================================
--- mgmt/trunk/wooly/python/wooly/profile.py 2009-11-04 16:04:51 UTC (rev 3694)
+++ mgmt/trunk/wooly/python/wooly/profile.py 2009-11-04 17:00:24 UTC (rev 3695)
@@ -44,6 +44,22 @@
print row % (widget, min(times), max(times), avg, count, total)
+ def print_process_render_asymmetry(self):
+ processed = set()
+ rendered = set()
+
+ for call in self.process_calls:
+ processed.add(call.widget)
+
+ for call in self.render_calls:
+ rendered.add(call.widget)
+
+ for widget in processed.difference(rendered):
+ print "Warning: %s was processed but not rendered" % widget
+
+ for widget in rendered.difference(processed):
+ print "Warning: %s was rendered but not processed" % widget
+
def print_stack_trace(self):
for call in self.current_calls:
print "in %s" % call
@@ -157,7 +173,7 @@
if self.widget.parent:
cls = self.widget.__class__
name = self.widget.__repr__()
- fmt = "<!-- \nopen: %s\n -->%s<!-- \nclose: %s\n -->"
+ fmt = "<!-- \nopen: %s\n-->%s<!-- \nclose: %s\n-->"
result = fmt % (name, result, name)
15 years, 4 months