Opened 15 years ago

Closed 12 years ago

#472 closed defect (fixed)

replicate3 test fails on flint on Windows

Reported by: Charlie Hull Owned by: Olly Betts
Priority: normal Milestone: 1.2.14
Component: Replication Version: 1.2.8
Severity: normal Keywords:
Cc: Blocked By:
Blocking: Operating System: Microsoft Windows

Description

As follows:

C:\work\xapian\xapian-SVN\xapian-core\tests>apitest -b flint replicate3 -v
Running tests with backend "flint"...
Running test: replicate3... FAILED
Expecting exception NetworkError
Caught expected NetworkError exception: NetworkError: read failed (Reached the end of the file.)
Expecting exception NetworkError
Caught expected NetworkError exception: NetworkError: read failed (Reached the end of the file.)
...
<multiple copies of this message until>
...
Caught expected NetworkError exception: NetworkError: Incomplete block in changeset
Expecting exception NetworkError
Caught expected NetworkError exception: NetworkError: Incomplete block in changeset
Expecting exception NetworkError
Caught expected NetworkError exception: NetworkError: Incomplete block in changeset
..\tests\dbcheck.cc:140: ((db.get_doccount()) == expected_doccount))
Expected `db.get_doccount()' and `expected_doccount' to be equal: were 1 and 2

apitest backend flint: 0 tests passed, 1 failed.

Change History (17)

comment:1 by Olly Betts, 15 years ago

Owner: changed from Olly Betts to Richard Boulton

Assigning to Richard as he added this testcase fairly recently.

comment:2 by Richard Boulton, 15 years ago

I've been trying to see what's going wrong here, but am a bit stuck so I've added a little extra debugging (in r14515) to try and help pin it down. If you could update and paste the output with that version, that should help.

comment:3 by Richard Boulton, 15 years ago

Status: newassigned

comment:4 by Charlie Hull, 15 years ago

Here you are:

Running tests with backend "flint"...
Running test: replicate3... FAILED
Trying replication with a changeset truncated to 10 bytes, from 10454 bytes
Expecting exception NetworkError
Caught expected NetworkError exception: NetworkError: read failed (Reached the end of the file.)
Trying replication with a changeset truncated to 11 bytes, from 10454 bytes
Expecting exception NetworkError
Caught expected NetworkError exception: NetworkError: read failed (Reached the end of the file.)
Trying replication with a changeset truncated to 12 bytes, from 10454 bytes
Expecting exception NetworkError
Caught expected NetworkError exception: NetworkError: read failed (Reached the end of the file.)
Trying replication with a changeset truncated to 13 bytes, from 10454 bytes
Expecting exception NetworkError
Caught expected NetworkError exception: NetworkError: read failed (Reached the end of the file.)
Trying replication with a changeset truncated to 14 bytes, from 10454 bytes
Expecting exception NetworkError
Caught expected NetworkError exception: NetworkError: read failed (Reached the end of the file.)
Trying replication with a changeset truncated to 15 bytes, from 10454 bytes
Expecting exception NetworkError
Caught expected NetworkError exception: NetworkError: read failed (Reached the end of the file.)
Trying replication with a changeset truncated to 16 bytes, from 10454 bytes
Expecting exception NetworkError
Caught expected NetworkError exception: NetworkError: read failed (Reached the end of the file.)
Trying replication with a changeset truncated to 17 bytes, from 10454 bytes
Expecting exception NetworkError
Caught expected NetworkError exception: NetworkError: read failed (Reached the end of the file.)
Trying replication with a changeset truncated to 18 bytes, from 10454 bytes
Expecting exception NetworkError
Caught expected NetworkError exception: NetworkError: read failed (Reached the end of the file.)
Trying replication with a changeset truncated to 19 bytes, from 10454 bytes
Expecting exception NetworkError
Caught expected NetworkError exception: NetworkError: read failed (Reached the end of the file.)
Trying replication with a changeset truncated to 20 bytes, from 10454 bytes
Expecting exception NetworkError
Caught expected NetworkError exception: NetworkError: read failed (Reached the end of the file.)
Trying replication with a changeset truncated to 21 bytes, from 10454 bytes
Expecting exception NetworkError
Caught expected NetworkError exception: NetworkError: read failed (Reached the end of the file.)
Trying replication with a changeset truncated to 22 bytes, from 10454 bytes
Expecting exception NetworkError
Caught expected NetworkError exception: NetworkError: read failed (Reached the end of the file.)
Trying replication with a changeset truncated to 23 bytes, from 10454 bytes
Expecting exception NetworkError
Caught expected NetworkError exception: NetworkError: read failed (Reached the end of the file.)
Trying replication with a changeset truncated to 24 bytes, from 10454 bytes
Expecting exception NetworkError
Caught expected NetworkError exception: NetworkError: read failed (Reached the end of the file.)
Trying replication with a changeset truncated to 25 bytes, from 10454 bytes
Expecting exception NetworkError
Caught expected NetworkError exception: NetworkError: read failed (Reached the end of the file.)
Trying replication with a changeset truncated to 26 bytes, from 10454 bytes
Expecting exception NetworkError
Caught expected NetworkError exception: NetworkError: read failed (Reached the end of the file.)
Trying replication with a changeset truncated to 27 bytes, from 10454 bytes
Expecting exception NetworkError
Caught expected NetworkError exception: NetworkError: read failed (Reached the end of the file.)
Trying replication with a changeset truncated to 28 bytes, from 10454 bytes
Expecting exception NetworkError
Caught expected NetworkError exception: NetworkError: read failed (Reached the end of the file.)
Trying replication with a changeset truncated to 29 bytes, from 10454 bytes
Expecting exception NetworkError
Caught expected NetworkError exception: NetworkError: read failed (Reached the end of the file.)
Trying replication with a changeset truncated to 30 bytes, from 10454 bytes
Expecting exception NetworkError
Caught expected NetworkError exception: NetworkError: read failed (Reached the end of the file.)
Trying replication with a changeset truncated to 1030 bytes, from 10454 bytes
Expecting exception NetworkError
Caught expected NetworkError exception: NetworkError: read failed (Reached the end of the file.)
Trying replication with a changeset truncated to 2030 bytes, from 10454 bytes
Expecting exception NetworkError
Caught expected NetworkError exception: NetworkError: read failed (Reached the end of the file.)
Trying replication with a changeset truncated to 3030 bytes, from 10454 bytes
Expecting exception NetworkError
Caught expected NetworkError exception: NetworkError: read failed (Reached the end of the file.)
Trying replication with a changeset truncated to 4030 bytes, from 10454 bytes
Expecting exception NetworkError
Caught expected NetworkError exception: NetworkError: read failed (Reached the end of the file.)
Trying replication with a changeset truncated to 5030 bytes, from 10454 bytes
Expecting exception NetworkError
Caught expected NetworkError exception: NetworkError: read failed (Reached the end of the file.)
Trying replication with a changeset truncated to 6030 bytes, from 10454 bytes
Expecting exception NetworkError
Caught expected NetworkError exception: NetworkError: read failed (Reached the end of the file.)
Trying replication with a changeset truncated to 7030 bytes, from 10454 bytes
Expecting exception NetworkError
Caught expected NetworkError exception: NetworkError: read failed (Reached the end of the file.)
Trying replication with a changeset truncated to 8030 bytes, from 10454 bytes
Expecting exception NetworkError
Caught expected NetworkError exception: NetworkError: read failed (Reached the end of the file.)
Trying replication with a changeset truncated to 9030 bytes, from 10454 bytes
Expecting exception NetworkError
Caught expected NetworkError exception: NetworkError: read failed (Reached the end of the file.)
Trying replication with a changeset truncated to 10030 bytes, from 10454 bytes
Expecting exception NetworkError
Caught expected NetworkError exception: NetworkError: read failed (Reached the end of the file.)
Trying replication with a changeset truncated to 10444 bytes, from 10454 bytes
Expecting exception NetworkError
Caught expected NetworkError exception: NetworkError: read failed (Reached the end of the file.)
Trying replication with a changeset truncated to 10445 bytes, from 10454 bytes
Expecting exception NetworkError
Caught expected NetworkError exception: NetworkError: read failed (Reached the end of the file.)
Trying replication with a changeset truncated to 10446 bytes, from 10454 bytes
Expecting exception NetworkError
Caught expected NetworkError exception: NetworkError: read failed (Reached the end of the file.)
Trying replication with a changeset truncated to 10447 bytes, from 10454 bytes
Expecting exception NetworkError
Caught expected NetworkError exception: NetworkError: read failed (Reached the end of the file.)
Trying replication with a changeset truncated to 10448 bytes, from 10454 bytes
Expecting exception NetworkError
Caught expected NetworkError exception: NetworkError: read failed (Reached the end of the file.)
Trying replication with a changeset truncated to 10449 bytes, from 10454 bytes
Expecting exception NetworkError
Caught expected NetworkError exception: NetworkError: read failed (Reached the end of the file.)
Trying replication with a changeset truncated to 10450 bytes, from 10454 bytes
Expecting exception NetworkError
Caught expected NetworkError exception: NetworkError: read failed (Reached the end of the file.)
Trying replication with a changeset truncated to 10451 bytes, from 10454 bytes
Expecting exception NetworkError
Caught expected NetworkError exception: NetworkError: Incomplete block in changeset
Trying replication with a changeset truncated to 10452 bytes, from 10454 bytes
Expecting exception NetworkError
Caught expected NetworkError exception: NetworkError: Incomplete block in changeset
Trying replication with a changeset truncated to 10453 bytes, from 10454 bytes
Expecting exception NetworkError
Caught expected NetworkError exception: NetworkError: Incomplete block in changeset
..\tests\dbcheck.cc:140: ((db.get_doccount()) == (expected_doccount))
Expected `db.get_doccount()' and `expected_doccount' to be equal: were 1 and 2


apitest backend flint: 0 tests passed, 1 failed.

comment:5 by Charlie Hull, 14 years ago

This test also hangs forever when using the Brass backend - not sure if this is related.

comment:6 by Charlie Hull, 14 years ago

If there's any way I can help to track this down, let me know: v1.2.3 doesn't pass the test suite because of this issue.

comment:7 by Charlie Hull, 14 years ago

This is still evident on 1.2.4

comment:8 by Charlie Hull, 14 years ago

This is still evident on 1.2.5. It's been a while since we could run the tests successfully on a Windows build, perhaps me and Richard should put our heads together and try and fix this one.

comment:9 by Charlie Hull, 14 years ago

replicate4 is also hanging forever on Brass.

comment:10 by Charlie Hull, 14 years ago

...and replicate2 hangs on Flint.

comment:11 by Charlie Hull, 14 years ago

Still evident on 1.2.6

comment:12 by Charlie Hull, 13 years ago

Still evident on 1.2.8

comment:13 by Olly Betts, 12 years ago

Milestone: 1.2.13
Version: SVN trunk1.2.8

I've just noticed that we're missing O_BINARY from a number of open() calls in the replication code in the library, and also in some of the replication tests. I suspect that is the cause of this problem.

It's now fixed on trunk (in r16961 and r16962). Marking to backport that for 1.2, but it would be great if you could test this.

comment:14 by Olly Betts, 12 years ago

Component: Backend-FlintReplication
Milestone: 1.2.131.2.x

Fixed the missing O_BINARY in 1.2 branch in r17007.

Not closing for now as I don't know if this will actually fix this issue.

comment:15 by Greg, 12 years ago

Tested with 1.2.13 on win7 x64, still hangs on replicate3, tried chert / flint and brass.

comment:16 by Olly Betts, 12 years ago

Milestone: 1.2.x1.2.14
Owner: changed from Richard Boulton to Olly Betts
Status: assignednew

Turns out that our RealTime::sleep() implementation for Windows is rather broken, and either doesn't sleep (if we're before the deadline) or sleeps for 43+ years (if we're after the deadline). Fixed in trunk r17071; boomboo confirmed on IRC that this patch makes replicate3 pass on Windows for chert, flint, and brass.

So once this is backported we can finally close this ticket!

comment:17 by Olly Betts, 12 years ago

Resolution: fixed
Status: newclosed

Backported to 1.2 branch in r17074.

Note: See TracTickets for help on using tickets.