adlnet / lrs-conformance-test-suite

A NodeJS project that tests the MUST requirements of the xAPI Spec and is based on the ADL testing requirements repository. The test suite website can be found here: https://lrstest.adlnet.gov/. The adopters website can be found here: https://adopters.adlnet.gov/

Home Page:https://adlnet.gov/projects/xapi/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Issue with the before all setTimeMargin helper function

TylerDixon opened this issue · comments

At the beginning of the test suite a function setTimeMargin is called. This stores a statement, immediately checking for it's existence to get the the difference between test suite and LRS endpoint. The problem with this statement is that it doesn't allow for the LRS's eventually consistent nature defined through the Consistent-Through headers.

All other statement-based tests that I can see in the test suite use the genDelay helper to query through to the eventually consistent time.

This can be pretty difficult to solve since these are the first API calls to the LRS through the suite and has no way to judge the Consistent-Through time. The two options coming to mind right now:

  • Allow for a configurable timeout between the initial POST and GET for setTimeMargin.
  • Retry the GET in setTimeMargin for some reasonable amount of time (Maybe configurable just as the previous option?) until you get a successful response (or fail the test if no successful response after the reasonable amount of time).

@TylerDixon I'd like your feedback on pr #201. Does that help solve this issue for you? Was there something else that needs tweaked, or something more that you were expecting?