Opened 7 years ago

Closed 7 years ago

#2972 closed defect (fixed)

MySqlLeaseMgrTest.checkVersion in lib/dhcpsrv fails in some environments

Reported by: tmark Owned by: tmark
Priority: medium Milestone: Sprint-DHCP-20130620
Component: database-all Version:
Keywords: Cc:
CVSS Scoring: Parent Tickets:
Sensitive: no Defect Severity: Medium
Sub-Project: DHCP Feature Depending on Ticket:
Estimated Difficulty: 0 Add Hours to Ticket: 0
Total Hours: 0 Internal?: no


The unit test fails on some VMs (notably 2 Debian6 VMs) but not all. The test fail with a status of MYSQL_NO_DATA in the result set fetch in MySqlLeaseMgr::getVersion().
This appears to be due to the use of autocommit and the read of the version table occuring before the insert of its data has been flushed. By added a "start transaction" at the beginning of the create statement in schema_copy.h and a "commit" to the end, the test passes. Explicit transactions cause InnoDB to flush its modfication logs immediately.

Note this test does not fail in all environments.


Change History (5)

comment:1 Changed 7 years ago by tmark

  • Milestone changed from DHCP Outstanding Tasks to Sprint-DHCP-20130606
  • Owner set to tmark
  • Status changed from new to assigned

comment:2 Changed 7 years ago by tmark

  • Owner changed from tmark to UnAssigned
  • Status changed from assigned to reviewing

Added explicit start transaction and commit statements as prescribed.
All unit tests now passes on the Debian VM that demonstrated the failure initially.

Do we want a ChangeLog entry for this?

comment:3 Changed 7 years ago by stephen

  • Owner changed from UnAssigned to stephen

comment:4 Changed 7 years ago by stephen

  • Owner changed from stephen to tmark

Reviewed commit 6849529f7e974888fcbc49c303b709d7c65002af

Works for me, please merge.

Do we want a ChangeLog entry for this?

I don't think we need it. This is an invisible change to a unit test.

comment:5 Changed 7 years ago by tmark

  • Resolution set to fixed
  • Status changed from reviewing to closed

Changes merged, git d09952e117b38c8f55a4abbb2f50ddba4874d86b

Note: See TracTickets for help on using tickets.