-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
XAPI-00254 The Activity Object must contain all available information.. #232
Comments
In the event that the LRS does not yet have any definition of the activity (let alone a canonical one), i would expect a 404 rather than fake, false data being returned. What sort of delay are you talking about and is that represented in your Consistent Through header you are returning? |
I started my LRS where the controllers will write the statements to DB synchronously and return back the status. In this model all the tests ran fine. With regard to delay, on the average I notice 30 to 60 seconds of delay between the controller request and the DB writes (not considering load, only test suite runs). I have not understood clearly on how Consistent Through header will help here. In my LRS, when it returns, this header is set to the current time. The DB writer tasks are written such that they write the current time when the statements are really written into DB. This way the data returned must be consistent with respect to returned time information. On the other hand, I tried to go through the sources in lrs-test-suite. In case XAPI-00254, first it POSTs 2 statements and expects 200 return code. Then immediately it sends a GET on Activities and expects 200 code. In my LRS, as the activity information is not yet updated in DB it returns 404. And the test suite reports 'failed'. So what I suspect is, instead of 'expect 200' these cases should atleast 'wait for 200 if 404', may be with a reasonable retry+delay. |
For reference, here is the log from test suite run,
|
Other cases that are failing, XAPI-00018 There is no defined way to inform back to the LRP that the asynchronous process at LRS end has completed the processing and stored the statements in to DB. |
I am working on a interim solution from LRS end. The Controller will wait (with a timeout say 60seconds) for the writer tasks to complete statements processing. |
Hi, I have the same issue. From the spec
So the xAPI spec accepts an asynchronous behavior on the Statement API, which is great because the database may be updated by a worker, and not directly by the web request. My implementationMy LRS supports both a synchronous recording mode and an asynchronous recording mode.
In my case, the asynchronous mode needs a short delay (<1 second) to update the statements AND activities in the database. What's wrong with XAPI-00254?The XAPI-00254 test assumes that the activities will be immediately available and updated after a statements POST. Suggested changeXAPI-00254 should first try to get the recorded statements (waiting them to be available, like in all the other tests), and then get the related activity definition. Note: I speak about XAPI-00254 because it's the first test to fail for this reason, but there may be other tests with the same issue. |
In this test case, it does POST on 2 statements and does a GET on Activities. My LRS is designed such that the POST request on Statements returns immediately and writing of the statements to back-end DB happens slightly at later point of time.
Due to this, GET on Activities does not find requested activity in the DB. But to meet the 'SHOULD' requirement of the spec, I return 200 OK with a dummy Activity object with the requested IRI as its id. But at the end, the test case evaluates to 'failed'. How do we handle it? Can the GET on Activity Resource return 404-NotFound and the test case to retry until a 200-OK response?
As per the specifications, 'The LRS MAY respond before Statements that have been stored are available for retrieval'. And on Activities Resource, 'If an LRS does not have a canonical definition of the Activity to return, the LRS SHOULD* still return an Activity Object when queried'.
The text was updated successfully, but these errors were encountered: