Changeset 135e3f6 for test


Ignore:
Timestamp:
10/01/15 17:29:38 (5 years ago)
Author:
Shane Alcock <salcock@…>
Branches:
4.0.1-hotfixes, cachetimestamps, develop, dpdk-ndag, etsilive, libtrace4, master, ndag_format, pfring, rc-4.0.1, rc-4.0.2, rc-4.0.3, rc-4.0.4, ringdecrementfix, ringperformance, ringtimestampfixes
Children:
01619eb
Parents:
2e9df89
Message:

Add usleep for first packet in all parallel tests

This ensures that the processing and reporting threads will still be
running when our test tries to pause them. Without this, our tests will
sometimes fail because we call pause on a trace that is finished (i.e. not
started).

Started noticing this with gcc 5.1.1, so might be due to better compiler
optimisations?

Location:
test
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • test/test-format-parallel-hasher.c

    r8decff7 r135e3f6  
    164164        assert(*magic == 0xabcdef);
    165165
     166        if (storage->count == 0)
     167                usleep(100000);
    166168        storage->count ++;
    167169        count ++;
  • test/test-format-parallel-reporter.c

    r8decff7 r135e3f6  
    164164        assert(*magic == 0xabcdef);
    165165
     166        if (storage->count == 0)
     167                usleep(100000);
    166168        storage->count ++;
    167169        count ++;
  • test/test-format-parallel-singlethreaded-hasher.c

    r8decff7 r135e3f6  
    154154        uint32_t *magic = (uint32_t *)global;
    155155        static __thread int count = 0;
    156         int a,*b,c=0;
     156        int a,*b,c=10;
    157157
    158158        assert(storage != NULL);
     
    164164        assert(*magic == 0xabcdef);
    165165
     166        if (storage->count == 0)
     167                usleep(100000);
    166168        storage->count ++;
    167169        count ++;
     
    176178        // Do some work to even out the load on cores
    177179        b = &c;
    178         for (a = 0; a < 10000000; a++) {
     180        for (a = 0; a < 50000000; a++) {
    179181                c += a**b;
    180182        }
  • test/test-format-parallel-singlethreaded.c

    r8decff7 r135e3f6  
    162162        assert(*magic == 0xabcdef);
    163163
     164        if (storage->count == 0)
     165                usleep(100000);
    164166        storage->count ++;
    165167        count ++;
  • test/test-format-parallel-stressthreads.c

    r8decff7 r135e3f6  
    130130        threadcounter->threads ++;
    131131        threadcounter->packets += res->value.sint;
    132         printf("%d\n", res->value.sint);
     132        //printf("%d\n", res->value.sint);
    133133}
    134134
     
    162162        assert(*magic == 0xabcdef);
    163163
     164        if (storage->count == 0)
     165                usleep(100000);
    164166        storage->count ++;
    165167        count ++;
  • test/test-format-parallel.c

    r8decff7 r135e3f6  
    162162        assert(*magic == 0xabcdef);
    163163
     164        if (storage->count == 0)
     165                usleep(100000);
    164166        storage->count ++;
    165167        count ++;
Note: See TracChangeset for help on using the changeset viewer.