Skip to content
  • Iustin Pop's avatar
    1fe0e999
    Make the XmParser config test runtime more consistent · 1fe0e999
    Iustin Pop authored
    
    
    Currently, the test uses a frequency of 5 string/5 double/1 list for
    generating Arbitrary instances of ListConfig. However, the list case
    has simply a "choose (1, 20)" `vectorOf` arbitrary, which means it
    could recurse forever.
    
    Manually running only this test gives runtime as such:
    
    - ~100-200ms: very often
    - ~1-2s: often
    - ~5s: rare
    - ~20s: very rare (but I hit this when running < 30 times the test,
      so…)
    
    On average, this makes this test one of the slowest ones, which is
    annoying.
    
    By changing to a sized generator, we can control the depth of the
    recursion, ensuring that we have a consistent runtime: out of 100
    runs, one is 229ms, one is 164ms, the other are 80-120ms.
    
    Signed-off-by: default avatarIustin Pop <iustin@google.com>
    Reviewed-by: default avatarGuido Trotter <ultrotter@google.com>
    1fe0e999
    Make the XmParser config test runtime more consistent
    Iustin Pop authored
    
    
    Currently, the test uses a frequency of 5 string/5 double/1 list for
    generating Arbitrary instances of ListConfig. However, the list case
    has simply a "choose (1, 20)" `vectorOf` arbitrary, which means it
    could recurse forever.
    
    Manually running only this test gives runtime as such:
    
    - ~100-200ms: very often
    - ~1-2s: often
    - ~5s: rare
    - ~20s: very rare (but I hit this when running < 30 times the test,
      so…)
    
    On average, this makes this test one of the slowest ones, which is
    annoying.
    
    By changing to a sized generator, we can control the depth of the
    recursion, ensuring that we have a consistent runtime: out of 100
    runs, one is 229ms, one is 164ms, the other are 80-120ms.
    
    Signed-off-by: default avatarIustin Pop <iustin@google.com>
    Reviewed-by: default avatarGuido Trotter <ultrotter@google.com>
Loading