Skip to content

Update test_group_4 to include changing state after rollback#13

Open
qirh wants to merge 3 commits into
PaulLockett:mainfrom
qirh:level_4_rollback_test_bug
Open

Update test_group_4 to include changing state after rollback#13
qirh wants to merge 3 commits into
PaulLockett:mainfrom
qirh:level_4_rollback_test_bug

Conversation

@qirh
Copy link
Copy Markdown

@qirh qirh commented Nov 26, 2024

As mentioned by others in Issue #8, I believe there is a bug in the test file for Level 4.

Order of Operations

  1. ["FILE_UPLOAD_AT", "2021-07-01T12:00:00", "Initial.txt", "100kb"]
  2. ["FILE_UPLOAD_AT", "2021-07-01T12:05:00", "Update1.txt", "150kb", 3600]
  3. ["FILE_GET_AT", "2021-07-01T12:10:00", "Initial.txt"]
  4. ["FILE_COPY_AT", "2021-07-01T12:15:00", "Update1.txt", "Update1Copy.txt"]
  5. ["FILE_UPLOAD_AT", "2021-07-01T12:20:00", "Update2.txt", "200kb", 1800]
  6. ["ROLLBACK", "2021-07-01T12:10:00"]
  7. ["FILE_GET_AT", "2021-07-01T12:25:00", "Update1.txt"]
  8. ["FILE_GET_AT", "2021-07-01T12:25:00", "Initial.txt"]
  9. ["FILE_SEARCH_AT", "2021-07-01T12:25:00", "Up"]
  10. ["FILE_GET_AT", "2021-07-01T12:25:00", "Update2.txt"]

Issue
After step 6 (ROLLBACK), the file Update2.txt should not exist because it was uploaded at 2021-07-01T12:20:00, which is after the rollback timestamp 2021-07-01T12:10:00.

Since the system is rolled back to the state as of 2021-07-01T12:10:00, any files uploaded after this timestamp should no longer exist. However, the test case appears to assume Update2.txt is still accessible after the rollback, which contradicts the expected behavior.

As mentioned in this issue (PaulLockett#8). I think there is a bug in the test file for level 4. 

This is the order of operations:
["FILE_UPLOAD_AT", "2021-07-01T12:00:00", "Initial.txt", "100kb"], 
            ["FILE_UPLOAD_AT", "2021-07-01T12:05:00", "Update1.txt", "150kb", 3600], 
            ["FILE_GET_AT", "2021-07-01T12:10:00", "Initial.txt"], 
            ["FILE_COPY_AT", "2021-07-01T12:15:00", "Update1.txt", "Update1Copy.txt"], 
            ["FILE_UPLOAD_AT", "2021-07-01T12:20:00", "Update2.txt", "200kb", 1800], 
            ["ROLLBACK", "2021-07-01T12:10:00"], 
            ["FILE_GET_AT", "2021-07-01T12:25:00", "Update1.txt"], 
            ["FILE_GET_AT", "2021-07-01T12:25:00", "Initial.txt"], 
            ["FILE_SEARCH_AT", "2021-07-01T12:25:00", "Up"],
            ["FILE_GET_AT", "2021-07-01T12:25:00", "Update2.txt"]
Comment thread practice_assessments/file_storage/test_simulation.py Outdated
qirh and others added 2 commits May 11, 2026 14:49
@qirh qirh requested review from alexbleakley and nikihowe May 11, 2026 18:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants