Skip to content

Fix flaky getResourceFromUri test by increasing httpTimeout (Skosmos 2)#1664

Merged
osma merged 1 commit intoskosmos-2from
fix-tests-increase-httptimeout
Aug 22, 2024
Merged

Fix flaky getResourceFromUri test by increasing httpTimeout (Skosmos 2)#1664
osma merged 1 commit intoskosmos-2from
fix-tests-increase-httptimeout

Conversation

@osma
Copy link
Member

@osma osma commented Aug 22, 2024

Reasons for creating this PR

One of the Skosmos 2 PHPUnit tests (ModelTest::testGetResourceFromUri) was frequently failing, e.g. this run.

The problem is that this test triggers a HTTP request to Finto, which can sometimes take a bit longer than 2 seconds. This causes a HTTP timeout in the LinkedDataResolver code. The fix is to increase the httpTimeout in testconfig.ttl to 8 seconds.

A very similar fix for another flaky test was done recently for Skosmos 3 in PR #1652 .

Link to relevant issue(s), if any

none

Description of the changes in this PR

  • increase httpTimeout from 2 to 8 seconds in testconfig.ttl
  • change the PHPUnit test that checks the httpTimeout value accordingly

Known problems or uncertainties in this PR

8 seconds should be enough for anyone, right?

Checklist

  • phpUnit tests pass locally with my changes
  • I have added tests that show that the new code works, or tests are not relevant for this PR (e.g. only HTML/CSS changes)
  • The PR doesn't reduce accessibility of the front-end code (e.g. tab focus, scaling to different resolutions, use of .sr-only class, color contrast)
  • The PR doesn't introduce unintended code changes (e.g. empty lines or useless reindentation)

@osma osma added bug tests Skosmos 2.X Relevant for Skosmos 2 labels Aug 22, 2024
@osma osma added this to the 2.x milestone Aug 22, 2024
@osma osma self-assigned this Aug 22, 2024
@sonarqubecloud
Copy link

@osma
Copy link
Member Author

osma commented Aug 22, 2024

CI tests passed, merging this.

@osma osma merged commit f24a25f into skosmos-2 Aug 22, 2024
@osma osma deleted the fix-tests-increase-httptimeout branch August 22, 2024 10:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Skosmos 2.X Relevant for Skosmos 2 tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant