Ticket #8 (closed defect: fixed)

Opened 2 years ago

Last modified 2 years ago

Editing "Hatta regression, Dec 12"

Reported by: sheep Owned by: sheep
Priority: Normal Milestone:
Component: Hatta Wiki Version: 1.3.3dev
Keywords: Cc:

Description

Something appears to have broken with the Dec 12 -r 48b9f0f7962c
relative to the Dec 11 -r c68df2f5b896

bash$ ./regress.sh 2>&1 | tee -a log-all
bash$ cat log-wget
WGET: PASS rev=0 Nov_29 -r 7b9857830021
WGET: PASS rev=1 Dec_04 -r 541b9b77637c
WGET: PASS rev=2 Dec_11 -r c68df2f5b896
WGET: FAIL rev=3 Dec_12A -r 48b9f0f7962c
WGET: FAIL rev=4 Dec_12B -r 09d10de2d623
WGET: FAIL rev=5 Current -r tip

regress.sh

#!/bin/bash
# Usage: ./regress.sh 2>&1 | tee -a log-all
#
# ls -altr test-*/index*
# ls -altr test-*/log
# less log-wget
# ps -alx|grep hatta
# rm -rf hatta-* test-* log*
# gvim -d hatta-Dec_11/hatta.py hatta-Dec_12A/hatta.py

echo ================== TEST ======================
echo `date`
echo

list_day=(Nov_29        Dec_04        Dec_11        Dec_12A       Dec_12B       Current)
list_rev=(7b9857830021  541b9b77637c  c68df2f5b896  48b9f0f7962c  09d10de2d623  tip    )

for ((rev = 0; $rev < ${#list_rev[*]}; rev += 1))
do
    test_day=${list_day[$rev]}
    test_rev=${list_rev[$rev]}

    # Record the date, test and results
    echo
    echo ================== NEXT TEST ======================
    echo `date`
    echo rev=${rev} $test_day -r $test_rev
    echo

    # Cleanup from any lingering test
    rm -rf hatta-$test_day test-$test_day

    # Clone specific revision and setup test
    hg clone http://hg.hatta-wiki.org/hatta-dev hatta-$test_day -r $test_rev
    mkdir -p test-$test_day/docs
    cp -p hatta-$test_day/hatta.py test-$test_day
    echo "== HELLO $rev $test_day -r $test_rev" > test-$test_day/docs/Home

    # Execute test
    ( cd test-$test_day
        #./hatta.py -i 0.0.0.0 -p 8080 2>&1 | tee log &
        ./hatta.py -i 0.0.0.0 -p 8080 > log 2>&1 &
        serv=$!
        echo PID= $serv
        sleep 3
        if wget --tries=1 localhost:8080 ; then
            msg="WGET: PASS rev=${rev} $test_day -r $test_rev"
        else
            msg="WGET: FAIL rev=${rev} $test_day -r $test_rev"
        fi
        echo $msg
        echo $msg  >> ../log-wget
        sleep 1
        kill $serv
        sleep 1
    )
done

Change History

comment:1 Changed 2 years ago by sheep

Can you provide some more details? Mercurial and Werkzeug version? Do you have cherrypy installed? Do you get any error message?  The change that apparently broke your test looks pretty harmless to me...


The script above is what I used to test with.

Here is some version info for Python and Mercurial.
I'm not sure how to query Werkzeug and Pygments version info.

bash$ python --version
Python 2.6.2
bash$ hg --version
Mercurial Distributed SCM (version 1.3.1)

Copyright (C) 2005-2009 Matt Mackall <mpm@selenic.com> and others
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
bash$ 

CherryPy version info... I guess?

bash$ ls -d /usr/local/lib/python2.6/dist-packages/Cherry*
/usr/local/lib/python2.6/dist-packages/CherryPy-3.1.2-py2.6.egg/

bash$ ls -d1 /var/lib/python-support/python2.6/Werkzeug* /var/lib/python-support/python2.6/Pygments* /var/lib/python-support/python2.6/mercurial* 
/var/lib/python-support/python2.6/mercurial/
/var/lib/python-support/python2.6/mercurial-1.1.2.egg-info@
/var/lib/python-support/python2.6/Pygments-0.10.egg-info/
/var/lib/python-support/python2.6/Werkzeug-0.4.1.egg-info/
bash$

Here are two logs, Dec_11 works, Dec_12A fails.
All PASS logs are essentially the same and
all FAIL logs too.

bash$ cat test-Dec_11/log
/usr/local/lib/python2.6/dist-packages/CherryPy-3.1.2-py2.6.egg/cherrypy/wsgiserver/__init__.py:1499: DeprecationWarning: The ability to pass multiple apps is deprecated and will be removed in 3.2. You should explicitly include a WSGIPathInfoDispatcher instead.
  DeprecationWarning)
bash$ 
bash$ cat test-Dec_12A/log
Traceback (most recent call last):
  File "./hatta.py", line 2973, in <module>
    main()
  File "./hatta.py", line 2946, in main
    wiki = Wiki(config)
  File "./hatta.py", line 2213, in __init__
    self.index = self.index_class(self.cache, self.language, self.storage)
  File "./hatta.py", line 1185, in __init__
    self.update(self)
  File "./hatta.py", line 1403, in update
    self.reindex(wiki, changed)
  File "./hatta.py", line 1371, in reindex
    page = wiki.get_page(request, title)
AttributeError: 'WikiSearch' object has no attribute 'get_page'
bash$

This helped a lot better, thanks! I missed a few obvious calls when refactoring the page reindexing. It wasn't triggered, because it only happens when your cache is outdated but you have any pages -- my unit tests didn't cover that case, I will have to add it. The version for which it failed for you was probably random -- it's just the expired cache... -- RadomirDopieralski


Got something similar clicking on ##backlink##:

Traceback (most recent call last):
  File "/var/lib/python-support/python2.5/werkzeug/utils.py", line 1539, in <lambda>
    return _patch_wrapper(f, lambda *a: f(*a)(*a[-2:]))
  File "/var/www/wiki/hatta/hatta.py", line 2922, in application
    return endpoint(request, **values)
  File "/var/www/wiki/hatta/hatta.py", line 2837, in backlinks
    self.index.update()
TypeError: update() takes exactly 3 arguments (1 given)

-- Ben


Thanks, fixed that one too. I definitely need to write more tests. I really wanted to make a release before Christmas, but development version seems pretty unstable at the moment... I need to work on stabilizing it a little. -- Radomir Dopieralski


I've just pushed   this new head to my dev branch that fix a couple of simple regressions I spotted this morning. Please apply.

-- Ben


Thank you, those errors are a little embarrassing. I fixed the obvious ones. I'd like to discuss the others, in particular: Why not allow space at the end of page names in links? Why do you need to explicitly cast page titles to strings in wanted pages? Feel free to report new bugs or write here. -- Radomir Dopieralski

comment:2 Changed 2 years ago by sheep

  • Priority set to Normal
  • Status changed from new to closed
  • Resolution set to fixed
Note: See TracTickets for help on using tickets.