•  
      request #35066 DB integration tests are flaky
    Infos
    #35066
    Joris MASSON (jmasson)
    2023-10-25 10:32
    2023-10-24 17:12
    36676
    Details
    DB integration tests are flaky

    Sometimes, some database integration tests fail, without obvious changes to the code that could explain why.
    After (a long) investigation, it turns out you should never write use ForgeConfigSandbox in a DB integration test. It will generate an instance of CodendiDataAccess with invalid DB credentials, which will make all subsequent requests by older DAO (the ones still extending \DataAccessObject) fail. The requests will fail despite the data being present, simply because the DAO cannot access the actual DB. The same requests made with DBFactory::getMainTuleapDBConnection()->getDB() will succeed, because it does not go through the same cache.

    Removing the trait makes the test suite pass again.

    Dev tools
    Empty
    Empty
    • [ ] enhancement
    • [ ] internal improvement
    Empty
    Stage
    Joris MASSON (jmasson)
    Closed
    2023-10-25
    Attachments
    Empty
    References
    Referencing request #35066

    Follow-ups