Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-79477

test_network_features() - Failed asserting that -1 is greater than 0.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • 4.1.6, 4.2.3
    • 3.9 regressions, 4.2.2
    • MoodleNet

      1) tool_moodlenet\local\remote_resource_test::test_network_features
      Failed asserting that -1 is greater than 0.

      This test was added by MDL-67883, when MoodleNet was added to core. It assumes that curl_getinfo()'s download_content_length value will be greater than zero on success. However, the default test URL is http://download.moodle.org/unittest/test.html and CloudFlare does not return a Content-Length header, so curl returns -1.

      The content-length of the download. This is the value read from theĀ Content-Length: field. -1 if the size isn't known

      The two options that I thought of:

      1. Modify the test to accept -1 as a valid value.
      2. Change the HEAD request to a GET request and return size_download instead of download_content_length.

            pholden Paul Holden
            jrchamp Jonathan Champ
            Jake Dallimore Jake Dallimore
            Sara Arjona (@sarjona) Sara Arjona (@sarjona)
            Kim Jared Lucas Kim Jared Lucas
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 45 minutes
                45m

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.