Giter Club home page Giter Club logo

Comments (8)

skaji avatar skaji commented on September 7, 2024 2

I could reproduce this test failure with not only 5.26.0-RC1 but also 5.24.1.

Now httpbin.org returns "X-Processed-Time" header whose length can be changed:

# length("0.0078330039978") == 15
❯ curl -sv http://httpbin.org/ 2>&1 | grep  X-Processed-Time
< X-Processed-Time: 0.0078330039978

# length("0.00656604766846") == 16
❯ curl -sv http://httpbin.org/ 2>&1 | grep  X-Processed-Time
< X-Processed-Time: 0.00656604766846

It seems that httpbin.org started using Flask-Common which injects "X-Processed-Time" header recently.
https://twitter.com/kennethreitz/status/862695319104094208

So tests that relies on HTTP header length of httpbin.org may fail.

In fact, if we remove "X-Processed-Time" header, then t/rt-112313.t passes.

diff --git a/t/rt-112313.t b/t/rt-112313.t
index f98040d..d33f32d 100644
--- a/t/rt-112313.t
+++ b/t/rt-112313.t
@@ -57,6 +57,14 @@ sub try

     my ($code, $mess, @headers) = $s->read_response_headers();

+    # XXX remove X-Processed-Time header
+    for my $i (0..$#headers) {
+        if ($headers[$i] eq 'X-Processed-Time') {
+            splice @headers, $i, 2;
+            last;
+        }
+    }
+
     my $body = '';
     while ($s->read_entity_body(my $buf, 1024))
     {
❯ prove -l t/rt-112313.t
t/rt-112313.t .. ok
All tests successful.
Files=1, Tests=40, 26 wallclock secs ( 0.03 usr  0.01 sys +  0.10 cusr  0.02 csys =  0.16 CPU)
Result: PASS

from net-http.

eserte avatar eserte commented on September 7, 2024 1

I created a CPAN.pm distroprefs file with @skaji's patch: https://github.com/eserte/srezic-cpan-distroprefs/blob/master/Net-HTTP.yml
So I can go on with smoking, especially with 5.26.0-RC1 smoking...

from net-http.

oalders avatar oalders commented on September 7, 2024

Thanks @genehack and @skaji. @genio should we just apply this fix for now to get beyond the immediate problem?

from net-http.

havoclad avatar havoclad commented on September 7, 2024

This test started failing mid-day yesterday for me with 5.16-3, the patch gets me past it.

Thanks for the quick work!

from net-http.

oalders avatar oalders commented on September 7, 2024

6.15 has been uploaded to CPAN. Thanks for your help everyone. :)

from net-http.

7kemZmani avatar 7kemZmani commented on September 7, 2024

still getting the same test failure :(
I downloaded, extracted, the latest Net-HTTP-6.17, on the latest macOS; then I ran:
perl Makefile.PL
followed by
prove -l t/rt-112313.t
I get:

t/rt-112313.t .. 15/? 
#   Failed test 'ok for n 1635 -> response length -1'
#   at t/rt-112313.t line 108.
# error: timeout at t/rt-112313.t line 89.
t/rt-112313.t .. 16/? 
#   Failed test 'ok for n 1636 -> response length -1'
#   at t/rt-112313.t line 108.
# error: timeout at t/rt-112313.t line 89.
....
t/rt-112313.t .. 39/? 
#   Failed test 'ok for n 2665 -> response length -1'
#   at t/rt-112313.t line 108.
# error: timeout at t/rt-112313.t line 89.

#   Failed test 'reponse length increased by 1'
#   at t/rt-112313.t line 112.
#          got: '0'
#     expected: '1'
# Looks like you failed 26 tests of 40.
t/rt-112313.t .. Dubious, test returned 26 (wstat 6656, 0x1a00)
Failed 26/40 subtests 

Test Summary Report
-------------------
t/rt-112313.t (Wstat: 6656 Tests: 40 Failed: 26)
  Failed tests:  15-40
  Non-zero exit status: 26
Files=1, Tests=40, 221 wallclock secs ( 0.06 usr  0.02 sys +  0.24 cusr  0.06 csys =  0.38 CPU)
Result: FAIL

did I do anything wrong?

from net-http.

karenetheridge avatar karenetheridge commented on September 7, 2024

from net-http.

7kemZmani avatar 7kemZmani commented on September 7, 2024

@karenetheridge
here's the full result of make test:

PERL_DL_NONLAZY=1 "/usr/local/Cellar/perl/5.26.1/bin/perl" "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/00-report-prereqs.t .. # 
# Versions for all modules listed in MYMETA.json (including optional ones):
# 
# === Configure Requires ===
# 
#     Module              Want Have
#     ------------------- ---- ----
#     ExtUtils::MakeMaker  any 7.24
# 
# === Configure Suggests ===
# 
#     Module      Want       Have
#     -------- ------- ----------
#     JSON::PP 2.27300 2.27400_02
# 
# === Build Requires ===
# 
#     Module              Want Have
#     ------------------- ---- ----
#     ExtUtils::MakeMaker  any 7.24
# 
# === Test Requires ===
# 
#     Module              Want     Have
#     ------------------- ---- --------
#     Data::Dumper         any    2.167
#     ExtUtils::MakeMaker  any     7.24
#     File::Spec           any     3.67
#     IO::Select           any     1.22
#     Socket               any 2.020_03
#     Test::More           any 1.302073
# 
# === Test Recommends ===
# 
#     Module         Want     Have
#     ---------- -------- --------
#     CPAN::Meta 2.120900 2.150010
# 
# === Runtime Requires ===
# 
#     Module                 Want  Have
#     ---------------------- ---- -----
#     Carp                    any  1.42
#     Compress::Raw::Zlib     any 2.074
#     IO::Socket::INET        any  1.35
#     IO::Uncompress::Gunzip  any 2.074
#     URI                     any  1.73
#     base                    any  2.26
#     strict                  any  1.11
#     vars                    any  1.03
#     warnings                any  1.37
# 
# === Runtime Suggests ===
# 
#     Module             Want  Have
#     ----------------- ----- -----
#     IO::Socket          any  1.38
#     IO::Socket::INET6   any  2.72
#     IO::Socket::IP      any  0.39
#     IO::Socket::SSL   2.012 2.052
#     Symbol              any  1.08
# 
t/00-report-prereqs.t .. ok   
t/http-nb.t ............ ok     
t/http.t ............... ok     
t/live-https.t ......... ok   
t/live.t ............... ok   
t/rt-112313.t .......... 15/? 
#   Failed test 'ok for n 1635 -> response length -1'
#   at t/rt-112313.t line 108.
# error: timeout at t/rt-112313.t line 89.
t/rt-112313.t .......... 16/? 
#   Failed test 'ok for n 1636 -> response length -1'
#   at t/rt-112313.t line 108.
# error: timeout at t/rt-112313.t line 89.

#   Failed test 'reponse length increased by 1'
#   at t/rt-112313.t line 112.
#          got: '0'
#     expected: '1'
t/rt-112313.t .......... 18/? 
#   Failed test 'ok for n 1637 -> response length -1'
#   at t/rt-112313.t line 108.
# error: timeout at t/rt-112313.t line 89.

#   Failed test 'reponse length increased by 1'
#   at t/rt-112313.t line 112.
#          got: '0'
#     expected: '1'
t/rt-112313.t .......... 20/? 
#   Failed test 'ok for n 1638 -> response length -1'
#   at t/rt-112313.t line 108.
# error: timeout at t/rt-112313.t line 89.

#   Failed test 'reponse length increased by 1'
#   at t/rt-112313.t line 112.
#          got: '0'
#     expected: '1'
t/rt-112313.t .......... 22/? 
#   Failed test 'ok for n 1639 -> response length -1'
#   at t/rt-112313.t line 108.
# error: timeout at t/rt-112313.t line 89.

#   Failed test 'reponse length increased by 1'
#   at t/rt-112313.t line 112.
#          got: '0'
#     expected: '1'
t/rt-112313.t .......... 24/? 
#   Failed test 'ok for n 1640 -> response length -1'
#   at t/rt-112313.t line 108.
# error: timeout at t/rt-112313.t line 89.

#   Failed test 'reponse length increased by 1'
#   at t/rt-112313.t line 112.
#          got: '0'
#     expected: '1'
t/rt-112313.t .......... 26/? 
#   Failed test 'ok for n 1641 -> response length -1'
#   at t/rt-112313.t line 108.
# error: timeout at t/rt-112313.t line 89.

#   Failed test 'reponse length increased by 1'
#   at t/rt-112313.t line 112.
#          got: '0'
#     expected: '1'
t/rt-112313.t .......... 28/? 
#   Failed test 'ok for n 2659 -> response length -1'
#   at t/rt-112313.t line 108.
# error: timeout at t/rt-112313.t line 89.
t/rt-112313.t .......... 29/? 
#   Failed test 'ok for n 2660 -> response length -1'
#   at t/rt-112313.t line 108.
# error: timeout at t/rt-112313.t line 89.

#   Failed test 'reponse length increased by 1'
#   at t/rt-112313.t line 112.
#          got: '0'
#     expected: '1'
t/rt-112313.t .......... 31/? 
#   Failed test 'ok for n 2661 -> response length -1'
#   at t/rt-112313.t line 108.
# error: timeout at t/rt-112313.t line 89.

#   Failed test 'reponse length increased by 1'
#   at t/rt-112313.t line 112.
#          got: '0'
#     expected: '1'
t/rt-112313.t .......... 33/? 
#   Failed test 'ok for n 2662 -> response length -1'
#   at t/rt-112313.t line 108.
# error: timeout at t/rt-112313.t line 89.

#   Failed test 'reponse length increased by 1'
#   at t/rt-112313.t line 112.
#          got: '0'
#     expected: '1'
t/rt-112313.t .......... 35/? 
#   Failed test 'ok for n 2663 -> response length -1'
#   at t/rt-112313.t line 108.
# error: timeout at t/rt-112313.t line 89.

#   Failed test 'reponse length increased by 1'
#   at t/rt-112313.t line 112.
#          got: '0'
#     expected: '1'
t/rt-112313.t .......... 37/? 
#   Failed test 'ok for n 2664 -> response length -1'
#   at t/rt-112313.t line 108.
# error: timeout at t/rt-112313.t line 89.

#   Failed test 'reponse length increased by 1'
#   at t/rt-112313.t line 112.
#          got: '0'
#     expected: '1'
t/rt-112313.t .......... 39/? 
#   Failed test 'ok for n 2665 -> response length -1'
#   at t/rt-112313.t line 108.
# error: timeout at t/rt-112313.t line 89.

#   Failed test 'reponse length increased by 1'
#   at t/rt-112313.t line 112.
#          got: '0'
#     expected: '1'
# Looks like you failed 26 tests of 40.
t/rt-112313.t .......... Dubious, test returned 26 (wstat 6656, 0x1a00)
Failed 26/40 subtests 

Test Summary Report
-------------------
t/rt-112313.t        (Wstat: 6656 Tests: 40 Failed: 26)
  Failed tests:  15-40
  Non-zero exit status: 26
Files=6, Tests=104, 225 wallclock secs ( 0.10 usr  0.04 sys +  1.48 cusr  0.28 csys =  1.90 CPU)
Result: FAIL
Failed 1/6 test programs. 26/104 subtests failed.
make: *** [test_dynamic] Error 26

from net-http.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.