Cadons / libtusclient

MIT License
2 stars 1 forks source link

Fix TUS tests #25

Open Cadons opened 1 week ago

Cadons commented 1 week ago

Description: During the TUS tests on Windows, there are issues with test file generation and upload. The application crashes intermittently while using CURL, sometimes before and sometimes after the requests are made. Additionally, the cancel and retry operations cause a crash due to a socket exception.

Interestingly, when uploading a regular file (not the test-generated file), everything works fine, suggesting that the problem may be tied to how the test file is handled or generated.

Steps to Reproduce:

  1. Generate a test file during the TUS test on a Windows environment.
  2. Attempt to upload the test file using CURL.
  3. Observe that CURL crashes either before or after the request is sent.
  4. Perform a cancel and retry operation.
  5. Observe the crash caused by a socket exception during these operations.

Expected Behavior:

Actual Behavior:

Additional Information:

Priority: Medium – Not blocking Windows release but requires attention before final performance and application testing.

Fahad-Ali-Khan-ca commented 4 days ago

Hi, I would like to take look at this issue.

Cadons commented 4 days ago

Hi, I would like to take look at this issue.

Sure, every contribution is welcome

Cadons commented 3 days ago

This is the docker-compose for the test enviroment with docker, i will push on the main branch when I finish my issue.


version: "3.0"

services:
  mockoon:
    image: mockoon/cli
    container_name: mockoon
    volumes:
      - ./mockoon-data.json:/data/mockoon-data.json
    environment:
      - MOCKOON_DATA=/data/mockoon-data.json
    command: --data /data/mockoon-data.json
    ports:
      - "3000:3000"

  tusd:
    image: tusproject/tusd
    container_name: tusd
    ports:
      - "8080:8080"
    command: |
      -host=0.0.0.0 \
      -port=8080 \
      -upload-dir=/data
    volumes:
      - ./data:/data`
Cadons commented 3 days ago

can you also fix the fact that sometimes upload is too fast and the tests can't get the correct status of the upload. I tried to put a parrallel check, but it is not always working. It happens on runner mac, on my mac it lawys works.

Fahad-Ali-Khan-ca commented 3 days ago

Hi , thanks for the additional details! I’ll look into the issues with the intermittent crashes and the fast uploads causing status checks to fail. I’ll test in the provided Docker environment and try to replicate the issue on a Mac runner to understand the differences. I’ll keep you updated on my progress!

Cadons commented 3 days ago

You could check if there aren't initialization or other strange things, because tests always pass on linux, but on mac os now they crash, the upload behavior is very strange because after 10 chunks it complete the upload. I will investigate this also, I will update if I find the issue and the solution

Cadons commented 2 days ago

You could check if there aren't initialization or other strange things, because tests always pass on linux, but on mac os now they crash, the upload behavior is very strange because after 10 chunks it complete the upload. I will investigate this also, I will update if I find the issue and the solution

I have fixed the pause, sometimes it seems there are some issue yet, if you find something wrong fix it, i have added an abort all in the pause call