Best unofficial Apache Server developers community
Username
Forgot password?
Sign in with Twitter account
Sign in with Facebook account
List archives

During unittest, changes not applied causing random test failure.

mongodump query by date on Windows
(24 lines)
Jan 25, 2011
Alex Dong
Alex Dong
In my python unit test, I have tests that randomly failed. They look like 
this:

1. db = pymongo.Connection()
2. assert db.profile.find_one({'_id': 1})['c'] == 2
3. db.profile.update({'_id': 1}, {'$inc': {'c': 1}})
4. assert db.profile.find_one({'_id': 1})['c'] == 3

Line 4 will fail quite randomly. Wondering what I should do to make sure 
line #4 always succeed? 
I have tried to add a time.sleep(1) between line #3 and #4, but it doesn't 
seem to help. 

Thanks, 
Alex





Reply
Tags: unit testpython
Messages in this thread
During unittest, changes not applied causing random test failure.
JAXB causing Unit Test Failure without any actual marshalling active
November 24, 2010 12:01:56 PM
Hi. We are planning to plug JAXB marshalling into our Camel routes. To start with I annotated DTOs for JAXB and create a schema for .NET clients. Next was to get Camel involved. However, simply adding the Maven dependency is causing the unit…
Created: (PIG-1682) zebra test configuration issue causing test failures
October 15, 2010 09:44:09 AM
zebra test configuration issue causing test failures
PATCH/puppet 1/1] [#4787] Missing require causing failure
September 21, 2010 03:22:27 PM
This code was using a constant that might not always be loaded. Signed-off-by: Jesse Wolfe <jes### @gmail.com> --- lib/puppet/type/tidy.rb | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/lib/puppet/type/tidy.rb…
Closed: (DERBY-3594) socket reset failure causing 17 networkserver tests to fail on ibm iseries
January 13, 2011 03:45:30 PM
[ https://issues.apache.org/jira/browse/DERBY-3594?page=com.atlassian.ji ra.plugin.system.issuetabpanels:all-tabpanel ] Myrna van Lunteren closed DERBY-3594.
Re: Random variables in a test script
September 22, 2010 09:24:52 AM
you can use the csv file to store randomize data and pass them in sampler.
Re: Random variables in a test script
September 24, 2010 10:25:36 AM
Hi Sree, Thanks for your help in the UDP issue. I was wondering once the parameter has been generated, how can I use the same variable throughout the script: First the variable is generated ${__V(Stock${__Random(1,2,)})} Then I want to use…
DO NOT REPLY New: Extra libs "-lrt-lcrypt" added causing compilation failure
November 25, 2010 04:49:36 AM
https://issues.apache.org/bugzilla/show_bug.cgi?id=50334 Summary: Extra libs "-lrt-lcrypt" added causing compilation failure Product: Apache httpd-2 Version: 2.2.17 Platform: PC …
Resolved: (HDFS-1286) Dry entropy pool on Hudson boxes causing test timeouts
December 20, 2010 11:24:49 PM
[ https://issues.apache.org/jira/browse/HDFS-1286?page=com.atlassian.jir a.plugin.system.issuetabpanels:all-tabpanel ] Konstantin Boudnik resolved HDFS-1286.
Created: (HIVE-1475) .gitignore files being placed in test warehouse directories causing build failu
July 21, 2010 10:47:50 AM
.gitignore files being placed in test warehouse directories causing build failure
Re: Howto unittest httpd modules?
November 22, 2010 07:44:14 AM
For mod_pagespeed <http://code.google.com/speed/page-speed/docs/module.html>we do 2 of the 3 testing modes discussed. We have the majority of our code running independent of Apache so it can be aggressively unit-tested with…
Re: Howto unittest httpd modules?
November 11, 2010 04:01:41 AM
On Thu, Nov 11, 2010 at 08:11, Edgar Frank <ef-li### @email.de> wrote: > Hi modules-dev-folks, > > I've written a handful of modules for httpd. I'm now looking for a way to setup some unit tests. We have continuous integration…
Re: Howto unittest httpd modules?
November 29, 2010 03:55:10 PM
On 11/24/2010 12:56 AM, Edgar Frank wrote: > Hi Pete, > > thanks for your reply (and all the others who replied). > > This sounds quite interesting and I'll see what I can make of it. > > [@http developers] > Looking at…
Re: Howto unittest httpd modules?
November 22, 2010 03:36:58 PM
Hi Edgar, You might consider the perl test harness -- Apache::Test on CPAN.org. mod_perl uses it. The test framework handles starting and stopping Apache, sending HTTP requests via WWW::Mechanize, and validating test results. It's full of…
unit test failure
July 14, 2010 10:03:21 AM
Hi, I am attempting to build the C client on debian lenny. autoconf, configure, make and make install all appear to work cleanly. I ran: autoreconf -if ./configure make make install make run-check However, the unit tests fail: $ make…
Test failure in MATH_2_X
January 18, 2011 10:01:56 AM
Hi. In MathUtils, I think that one of the test for "equals(float, float)" assumes the new semantics (trunk) whereas the code there checks for strict equality. Gilles
C client unit test failure
August 7, 2010 06:58:18 PM
Hello, I'm having 2 issues while compiling/running c client unit test in branch-3.3. 1. I get this error from "make check": g++: unrecognized option `-static-libtool-libs' 2. testAsyncWatcherAutoReset is not working for me. …
Test failure after building from svn repo
August 14, 2010 07:23:26 PM
Hi, I am on a PPC Mac running OS X 10.4. Using MacPorts I installed all the dependencies. I then checked out the svn trunk (this afternoon). Following the instructions, I got a clean build. When I ran 'make check', it showed one failure. …
DO NOT REPLY Fix occasional test failure in TestConcurrency
August 4, 2010 11:41:16 AM
https://issues.apache.org/bugzilla/show_bug.cgi?id=47583 Mark Thomas <mar### @apache.org> changed: What |Removed |Added
SsaslGssapiBind test failure problem identified
August 13, 2010 12:16:09 AM
On Thu, Aug 12, 2010 at 10:51 AM, Emmanuel Lecharny <elech### @gmail.com>wrote: > On 8/12/10 4:24 PM, feez### @gdls.com wrote: > >> Gentlemen, >> > Hi, > > My home system is Fedora Core 13 Linux with the Sun JDK…
Created: (JDO-665) api test failure under maven 2, Java 1.6
August 20, 2010 11:24:56 AM
api test failure under maven 2, Java 1.6
MySQL: How to retrieve a random row or multiple random rows?
January 3, 2011
I have a MySQL database table that stores the URLs of photos. I need to pull 5 random records from the database of a particular type. I can pull 5…
Regex to match test<not ABC>test
January 10, 2011
Hi, I'm using Oracle regural expressions and I want to match some string, then something different to another string and then another string. For…
(monit) What does failure "Changed" mean
March 23, 2010
Hi, I installed monit on my server and tried to monitor nginx. check process nginx with pidfile /var/run/nginx.pid start program =…
Hadoop namenode single point of failure
December 21, 2010
The namenode in the hadoop architecture is a single point of failure. How do people who have large hadoop clusters cope with this problem. Is there…
PEAR error: mail() returned failure
November 25, 2010
While registering the user in status.net package i got following error: PEAR error: mail() returned failure ServerErrorAction: 500 An important…
Intermittent INSERT failure to mysql table
January 12, 2011
Simple php/mysql INSERT such as mysql_query("INSERT INTO dispatch VALUES('1234','$name','$address')"); intermittently fails. I've set it up to trap…
Coldfusion 9 MySQL communications link failure
December 21, 2010
I've just installed Coldfusion 9, and everything is now working fine and it's connected to my MySQL databse via the Coldfusion Administrator as a…
Ejabberd php mysql external auth failure and termination
December 26, 2010
Hi, I am trying to setup extauth with ejabberd, however i just cannot get it working (even after googling for a fix on web). I have set following…
Assertion Failure unable to wirte readonly database?????
December 24, 2010
Hi , I am facing a problem with sqlite database when ever i try to save favorite throws an exception Assertion failure unable to write read-only…
SQLite question? Podcast Producer server failure
October 27, 2009
Suddenly this morning none of my recording machines can connect to the server. There were no software updates on the client or server side this…
.htaccess causing redirect loop
December 28, 2010
I have a URL on my site that works without a / but when I add a / it says there's a redirect loop... I'm struggling to see the problem here...…
Php_value auto_prepend - causing 500 error?
January 12, 2011
I have a project which uses the following in .htaccess: php_value auto_prepend_file /home/-path-here/prepend.php This works fine on my local WAMP…
What is causing a Hibernate SQL query exception?
January 12, 2011
Hi all and sorry in advance for this post but I've spent way too much time going around in circles so I'm hoping someone could shed a light on it…
Redis master/slave replication - single point of failure?
January 17, 2011
How does one upgrade to a newer version of Redis with zero downtime? Redis slaves are read-only, so it seems like you'd have to take down the master…
Why is my apache2, mod_fcgid, php configuration causing 100% cpu usage?
January 10, 2011
Page load makes a quick initial connection, then hangs about 10 seconds before the page renders. When the server load goes up I start watching top…
JFTP in Joomla - ftp_put in PHP causing a 550 Error
January 17, 2011
I have been trying to install Joomla 1.5 on server running Ubuntu 10.10 and Apache2 with a mysql database. I have PHP5 installed, and the first part…
Frontloading mod_rewrite rule is causing index.php to load twice.
January 7, 2011
I've been working on a project that uses a frontloader to handle all requests (Routing domain.com/args/go/here to Index.php?req=args/go/here), and…
Do servlet containers prevent web applications from causing each other interference and how do they do it?
December 22, 2010
I know that a servlet container, such as Apache Tomcat, runs in a single instance of the JVM, which means all of its servlets will run in the same…
Model Manager filtering on Boolean causing IntegrityError
January 8, 2011
I am using a Manager on a model based on a Boolean field to filter the objects displayed on the site while showing all objects in the admin…
UFW: Cannot get localhost to loopback causing nginx 504 Gateway Timeout with PHP
January 20, 2011
Hi, I'm setting up ufw for the first time. Using Ubuntu 10.04 LTS on an OpenVZ VPN and have the following rules: sudo ufw allow 22/tcp sudo ufw…