Skip to content
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

xmlhttprequest: Don't pass total value on timeout #24477

Closed
wants to merge 1 commit into from

Conversation

@santoshs
Copy link

santoshs commented Oct 17, 2019

fixes: #24286

Signed-off-by: Santosh Sivaraj santosh@fossix.org

Progress event should not get total/partial load values on timeout. Fix to pass 0 in the error path.


  • ./mach build -d does not report any errors
  • ./mach test-tidy does not report any errors
  • These changes fix #24286
  • There are tests for these changes OR
  • These changes do not require tests because ___
@highfive
Copy link

highfive commented Oct 17, 2019

Thanks for the pull request, and welcome! The Servo team is excited to review your changes, and you should hear from @SimonSapin (or someone else) soon.

@highfive
Copy link

highfive commented Oct 17, 2019

Heads up! This PR modifies the following files:

  • @asajeffrey: components/script/dom/xmlhttprequest.rs
  • @KiChjang: components/script/dom/xmlhttprequest.rs
@highfive
Copy link

highfive commented Oct 17, 2019

warning Warning warning

  • These commits modify script code, but no tests are modified. Please consider adding a test!
@santoshs santoshs force-pushed the santoshs:gi24286-xhr branch from 339b6f8 to 569b083 Oct 18, 2019
@jdm
Copy link
Member

jdm commented Oct 18, 2019

@bors-servo try=wpt

@bors-servo
Copy link
Contributor

bors-servo commented Oct 18, 2019

Trying commit 569b083 with merge 529c384...

bors-servo added a commit that referenced this pull request Oct 18, 2019
xmlhttprequest: Don't pass total value on timeout

fixes: #24286

Signed-off-by: Santosh Sivaraj <santosh@fossix.org>

<!-- Please describe your changes on the following line: -->

Progress event should not get total/partial load values on timeout. Fix to pass 0 in the error path.

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #24286

<!-- Either: -->
- [X] There are tests for these changes OR
- [ ] These changes do not require tests because ___
@bors-servo
Copy link
Contributor

bors-servo commented Oct 18, 2019

💔 Test failed - linux-rel-wpt

@CYBAI
Copy link
Collaborator

CYBAI commented Oct 18, 2019

Cool! More tests PASS now! but one (/xhr/send-response-event-order.htm) became FAIL from PASS 👀

{
    "status": "PASS", 
    "group": "default", 
    "message": null, 
    "stack": null, 
    "subtest": "XMLHttpRequest: abort() while sending data", 
    "test": "/xhr/abort-during-upload.any.html", 
    "line": 220966, 
    "action": "test_result", 
    "expected": "FAIL"
}
{
    "status": "PASS", 
    "group": "default", 
    "message": null, 
    "stack": null, 
    "subtest": "XMLHttpRequest: event - error (order of events)", 
    "test": "/xhr/event-error-order.sub.html", 
    "line": 256012, 
    "action": "test_result", 
    "expected": "FAIL"
}
{
    "status": "PASS", 
    "group": "default", 
    "message": null, 
    "stack": null, 
    "subtest": "XMLHttpRequest: event - timeout (order of events)", 
    "test": "/xhr/event-timeout-order.any.worker.html", 
    "line": 321442, 
    "action": "test_result", 
    "expected": "FAIL"
}
{
    "status": "PASS", 
    "group": "default", 
    "message": null, 
    "stack": null, 
    "subtest": "XMLHttpRequest: The abort() method: abort and loadend events", 
    "test": "/xhr/abort-event-order.htm", 
    "line": 332039, 
    "action": "test_result", 
    "expected": "FAIL"
}
{
    "status": "PASS", 
    "group": "default", 
    "message": null, 
    "stack": null, 
    "subtest": "XMLHttpRequest: event - timeout (order of events)", 
    "test": "/xhr/event-timeout-order.any.html", 
    "line": 332411, 
    "action": "test_result", 
    "expected": "FAIL"
}
{
    "status": "FAIL", 
    "group": "default", 
    "message": "assert_equals: expected \"upload.progress(12,12,true)\" but got \"upload.progress(0,0,false)\"", 
    "stack": "global.assert_xhr_event_order_matches@http://web-platform.test:8000/xhr/resources/xmlhttprequest-event-order.js:74:7\n@http://web-platform.test:8000/xhr/send-response-event-order.htm:31:17\nTest.prototype.step@http://web-platform.test:8000/resources/testharness.js:1908:25\nTest.prototype.step_func/<@http://web-platform.test:8000/resources/testharness.js:1932:35\n", 
    "subtest": "XMLHttpRequest: The send() method: event order when synchronous flag is unset", 
    "test": "/xhr/send-response-event-order.htm", 
    "line": 332877, 
    "action": "test_result", 
    "expected": "PASS"
}
{
    "status": "PASS", 
    "group": "default", 
    "message": null, 
    "stack": null, 
    "subtest": "XMLHttpRequest: abort() while sending data", 
    "test": "/xhr/abort-during-upload.any.worker.html", 
    "line": 348925, 
    "action": "test_result", 
    "expected": "FAIL"
}
{
    "status": "PASS", 
    "group": "default", 
    "message": null, 
    "stack": null, 
    "subtest": "XMLHttpRequest: The send() method: timeout is not 0 ", 
    "test": "/xhr/send-timeout-events.htm", 
    "line": 363579, 
    "action": "test_result", 
    "expected": "FAIL"
}
Copy link
Member

jdm left a comment

With this change, we shouldn't have any new test failures.

components/script/dom/xmlhttprequest.rs Outdated Show resolved Hide resolved
@jdm
Copy link
Member

jdm commented Oct 21, 2019

The expected test results will need to be updated to include the newly passing tests.

@jdm jdm assigned jdm and unassigned SimonSapin Oct 21, 2019
@jdm
Copy link
Member

jdm commented Nov 7, 2019

@santoshs Are you planning to finish this PR?

@santoshs
Copy link
Author

santoshs commented Nov 8, 2019

@santoshs Are you planning to finish this PR?

@jdm Yes, I was on vacation, so the very late response. Will send a updated pull request today.

Progress event should not get total/partial load values on timeout. Fix to
pass 0 in the error path.

fixes: #24286

Signed-off-by: Santosh Sivaraj <santosh@fossix.org>
@community-tc-integration

This comment has been minimized.

Copy link

community-tc-integration bot commented on 08bf7ac Nov 8, 2019

Submitting the task to Taskcluster failed. Details

Taskcluster-GitHub attempted to create a task for this event with the following scopes:

[
  "assume:repo:github.com/servo/servo:pull-request",
  "queue:route:statuses",
  "queue:scheduler-id:taskcluster-github"
]

The expansion of these scopes is not sufficient to create the task, leading to the following:

Client ID static/taskcluster/github does not have sufficient scopes and is missing the following scopes:

{
  "AnyOf": [
    {
      "AnyOf": [
        "queue:create-task:highest:aws-provisioner-v1/servo-docker-untrusted",
        "queue:create-task:very-high:aws-provisioner-v1/servo-docker-untrusted",
        "queue:create-task:high:aws-provisioner-v1/servo-docker-untrusted",
        "queue:create-task:medium:aws-provisioner-v1/servo-docker-untrusted",
        "queue:create-task:low:aws-provisioner-v1/servo-docker-untrusted",
        "queue:create-task:very-low:aws-provisioner-v1/servo-docker-untrusted",
        "queue:create-task:lowest:aws-provisioner-v1/servo-docker-untrusted"
      ]
    },
    {
      "AnyOf": [
        "queue:create-task:aws-provisioner-v1/servo-docker-untrusted",
        {
          "AllOf": [
            "queue:define-task:aws-provisioner-v1/servo-docker-untrusted",
            "queue:task-group-id:taskcluster-github/LHG4F0X7QhqI5vxn_bqQ_Q",
            "queue:schedule-task:taskcluster-github/LHG4F0X7QhqI5vxn_bqQ_Q/LHG4F0X7QhqI5vxn_bqQ_Q"
          ]
        }
      ]
    }
  ]
}

This request requires the client to satisfy the following scope expression:

{
  "AllOf": [
    "assume:repo:github.com/servo/servo:pull-request",
    "queue:route:tc-treeherder.v2._/servo-prs.08bf7ac536f7e989b563ca22f8112d0afb8eac75",
    "queue:route:tc-treeherder-staging.v2._/servo-prs.08bf7ac536f7e989b563ca22f8112d0afb8eac75",
    "queue:route:statuses",
    {
      "AnyOf": [
        {
          "AllOf": [
            "queue:scheduler-id:taskcluster-github",
            {
              "AnyOf": [
                "queue:create-task:highest:aws-provisioner-v1/servo-docker-untrusted",
                "queue:create-task:very-high:aws-provisioner-v1/servo-docker-untrusted",
                "queue:create-task:high:aws-provisioner-v1/servo-docker-untrusted",
                "queue:create-task:medium:aws-provisioner-v1/servo-docker-untrusted",
                "queue:create-task:low:aws-provisioner-v1/servo-docker-untrusted",
                "queue:create-task:very-low:aws-provisioner-v1/servo-docker-untrusted",
                "queue:create-task:lowest:aws-provisioner-v1/servo-docker-untrusted"
              ]
            }
          ]
        },
        {
          "AnyOf": [
            "queue:create-task:aws-provisioner-v1/servo-docker-untrusted",
            {
              "AllOf": [
                "queue:define-task:aws-provisioner-v1/servo-docker-untrusted",
                "queue:task-group-id:taskcluster-github/LHG4F0X7QhqI5vxn_bqQ_Q",
                "queue:schedule-task:taskcluster-github/LHG4F0X7QhqI5vxn_bqQ_Q/LHG4F0X7QhqI5vxn_bqQ_Q"
              ]
            }
          ]
        }
      ]
    }
  ]
}

  • method: createTask
  • errorCode: InsufficientScopes
  • statusCode: 403
  • time: 2019-11-08T04:46:38.573Z
self.dispatch_upload_progress_event(atom!("progress"), Err(()));
return_if_fetch_was_terminated!();
self.dispatch_upload_progress_event(atom!("load"), None);
self.dispatch_upload_progress_event(atom!("load"), Err(()));
Comment on lines +1054 to +1056

This comment has been minimized.

Copy link
@jdm

jdm Nov 8, 2019

Member

These two lines should use Ok(Some(0)), since this is not an error code path.

This comment has been minimized.

Copy link
@santoshs

santoshs Nov 9, 2019

Author

@jdm thanks for the review. The servo build most of time gets killed because of lack of memory, I have a 8 GB system. I have read somewhere that using llvm linker would use less memory, any idea how to set that up? I have a fedora 30 machine.

This comment has been minimized.

Copy link
@jdm

jdm Nov 9, 2019

Member

Based on rust-lang/rust#39915 (comment) and rust-lang/rust#39915 (comment), I think you would need to follow these instructions and modify the rustflags entry to include -C linker=rust-lld.

@jdm jdm added this to In progress in web-platform-test failures Nov 29, 2019
@jdm
Copy link
Member

jdm commented Jan 21, 2020

Closing due to inactivity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Linked issues

Successfully merging this pull request may close these issues.

6 participants
You can’t perform that action at this time.