[PATCH 0/4] Rewrite the test OOM checking code

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: "Daniel P. Berrange" <berrange@xxxxxxxxxx>

This rewrites the OOM checking code to be much much much
more scalable. Instead of looping running 'main' multiple
times, we loop running 'virtTestRun' multiple times. Although
the overall number of mallocs to be checked is basically the
same, checking them in small blocks is a massive efficiency
win, because the complexity is 'n * (n + 1) / 1'.

Although I've fixed many issues, there are still some big
problems remaining

 - The APIs in virxml.h don't let the caller distinguish
   between "attribute not found" and other errors.  So
   anywhere we have an attribute that is optional, we are
   failing to diagnose & report OOM correctly (or indeed
   other errors we might get from libxml)

 - It is desirable to validate that we get VIR_ERR_NO_MEMORY
   for each failure, but there are times where we won't
   get this. In particular with any of the APIs which have
   delayed error reporting such as virCommand and virBuffer.
   You can see an OOM from those APIs, but there's a window
   between that occurring & being reported, where another
   error may be reported.

 - We should not count allocs in virerror.c or virlog.c APIs
   when doing OOM testing, since they're intentionally non-fatal

Daniel P. Berrange (4):
  Don't clobber 'ret' variable in testCompareXMLToXMLHelper
  Remove existing OOM test impl
  Remove test case average timing
  Introduce new OOM testing support

 tests/commandtest.c               |   2 +-
 tests/cputest.c                   |   5 +-
 tests/domainsnapshotxml2xmltest.c |   2 +-
 tests/esxutilstest.c              |   2 +-
 tests/fchosttest.c                |  10 +-
 tests/fdstreamtest.c              |   8 +-
 tests/interfacexml2xmltest.c      |   6 +-
 tests/jsontest.c                  |   2 +-
 tests/libvirtdconftest.c          |   2 +-
 tests/lxcxml2xmltest.c            |   4 +-
 tests/metadatatest.c              |   6 +-
 tests/networkxml2conftest.c       |   2 +-
 tests/networkxml2xmltest.c        |   2 +-
 tests/networkxml2xmlupdatetest.c  |   2 +-
 tests/nodedevxml2xmltest.c        |   6 +-
 tests/nodeinfotest.c              |   2 +-
 tests/nwfilterxml2xmltest.c       |   2 +-
 tests/openvzutilstest.c           |   2 +-
 tests/qemuagenttest.c             |   4 +-
 tests/qemuargv2xmltest.c          |  18 +-
 tests/qemuhelptest.c              |   2 +-
 tests/qemuhotplugtest.c           |   2 +-
 tests/qemumonitorjsontest.c       |   8 +-
 tests/qemumonitortest.c           |   2 +-
 tests/qemuxml2argvtest.c          |  14 +-
 tests/qemuxml2xmltest.c           |  25 +--
 tests/qemuxmlnstest.c             |  20 +-
 tests/securityselinuxlabeltest.c  |   6 +-
 tests/securityselinuxtest.c       |   2 +-
 tests/sexpr2xmltest.c             |   2 +-
 tests/sockettest.c                |  16 +-
 tests/statstest.c                 |   2 +-
 tests/storagepoolxml2xmltest.c    |   6 +-
 tests/storagevolxml2argvtest.c    |   2 +-
 tests/storagevolxml2xmltest.c     |  14 +-
 tests/sysinfotest.c               |   2 +-
 tests/testutils.c                 | 386 ++++++++++++++++++++------------------
 tests/testutils.h                 |   3 +-
 tests/utiltest.c                  |   4 +-
 tests/viratomictest.c             |   4 +-
 tests/virauthconfigtest.c         |   2 +-
 tests/virbitmaptest.c             |  18 +-
 tests/virbuftest.c                |   2 +-
 tests/vircgrouptest.c             |  22 +--
 tests/virdbustest.c               |  10 +-
 tests/virdrivermoduletest.c       |   2 +-
 tests/virendiantest.c             |   4 +-
 tests/virhashtest.c               |   2 +-
 tests/viridentitytest.c           |   4 +-
 tests/virkeycodetest.c            |   4 +-
 tests/virkeyfiletest.c            |   2 +-
 tests/virlockspacetest.c          |  14 +-
 tests/virnetmessagetest.c         |  10 +-
 tests/virnetserverclienttest.c    |   2 +-
 tests/virnetsockettest.c          |  30 +--
 tests/virnettlscontexttest.c      |   2 +-
 tests/virnettlssessiontest.c      |   4 +-
 tests/virportallocatortest.c      |   4 +-
 tests/virshtest.c                 |  36 ++--
 tests/virstoragetest.c            |   2 +-
 tests/virstringtest.c             |   8 +-
 tests/virsystemdtest.c            |  10 +-
 tests/virtimetest.c               |   2 +-
 tests/viruritest.c                |   2 +-
 tests/vmwarevertest.c             |   2 +-
 tests/vmx2xmltest.c               |   2 +-
 tests/xencapstest.c               |  22 +--
 tests/xmconfigtest.c              |   4 +-
 tests/xml2sexprtest.c             |   2 +-
 tests/xml2vmxtest.c               |   2 +-
 70 files changed, 436 insertions(+), 407 deletions(-)

-- 
1.8.3.1

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]