r0man / oauth-clj

Clojure OAuth library
95 stars 27 forks source link

oauth.twitter-test/test-update-status-query-params throws exception #11

Closed canweriotnow closed 10 years ago

canweriotnow commented 10 years ago

Trace:

lein test :only oauth.twitter-test/test-update-status-query-params

ERROR in (test-update-status-query-params) (client.clj:147)
Uncaught exception, not in assertion.
expected: nil
  actual: clojure.lang.ExceptionInfo: clj-http: status 403
 at clj_http.client$wrap_exceptions$fn__1775.invoke (client.clj:147)
    clj_http.client$wrap_accept$fn__1922.invoke (client.clj:478)
    clj_http.client$wrap_accept_encoding$fn__1928.invoke (client.clj:492)
    clj_http.client$wrap_content_type$fn__1917.invoke (client.clj:467)
    clj_http.client$wrap_form_params$fn__1968.invoke (client.clj:583)
    clj_http.client$wrap_nested_params$fn__1986.invoke (client.clj:607)
    clj_http.client$wrap_method$fn__1963.invoke (client.clj:566)
    clj_http.cookies$wrap_cookies$fn__231.invoke (cookies.clj:121)
    clj_http.links$wrap_links$fn__268.invoke (links.clj:50)
    clj_http.client$wrap_unknown_host$fn__1995.invoke (client.clj:626)
    oauth.io$wrap_input_coercion$fn__3073.invoke (io.clj:80)
    oauth.io$wrap_output_coercion$fn__3076.invoke (io.clj:86)
    oauth.io$wrap_meta_response$fn__3069.invoke (io.clj:73)
    oauth.util$wrap_content_type$fn__2989.invoke (util.clj:167)
    oauth.v1$wrap_oauth_authorization$fn__3457.invoke (v1.clj:88)
    oauth.v1$wrap_oauth_signature$fn__3468.invoke (v1.clj:109)
    clj_http.client$wrap_url$fn__1990.invoke (client.clj:617)
    oauth.v1$wrap_oauth_defaults$fn__3463.invoke (v1.clj:101)
    oauth.twitter_test/fn (twitter_test.clj:77)
    clojure.test$test_var$fn__7145.invoke (test.clj:701)
    clojure.test$test_var.invoke (test.clj:701)
    clojure.test$test_all_vars$fn__7149$fn__7156.invoke (test.clj:717)
    clojure.test$default_fixture.invoke (test.clj:671)
    clojure.test$test_all_vars$fn__7149.invoke (test.clj:717)
    clojure.test$default_fixture.invoke (test.clj:671)
    clojure.test$test_all_vars.invoke (test.clj:713)
    clojure.test$test_ns.invoke (test.clj:736)
    clojure.core$map$fn__4207.invoke (core.clj:2487)
    clojure.lang.LazySeq.sval (LazySeq.java:42)
    clojure.lang.LazySeq.seq (LazySeq.java:60)
    clojure.lang.Cons.next (Cons.java:39)
    clojure.lang.RT.next (RT.java:598)
    clojure.core$next.invoke (core.clj:64)
    clojure.core$reduce1.invoke (core.clj:896)
    clojure.core$reduce1.invoke (core.clj:887)
    clojure.core$merge_with.doInvoke (core.clj:2702)
    clojure.lang.RestFn.applyTo (RestFn.java:139)
    clojure.core$apply.invoke (core.clj:619)
    clojure.test$run_tests.doInvoke (test.clj:751)
    clojure.lang.RestFn.applyTo (RestFn.java:137)
    clojure.core$apply.invoke (core.clj:617)
    user$eval85$fn__140$fn__171.invoke (form-init6997513064397992800.clj:1)
    user$eval85$fn__140$fn__141.invoke (form-init6997513064397992800.clj:1)
    user$eval85$fn__140.invoke (form-init6997513064397992800.clj:1)
    user$eval85.invoke (form-init6997513064397992800.clj:1)
    clojure.lang.Compiler.eval (Compiler.java:6619)
    clojure.lang.Compiler.eval (Compiler.java:6609)
    clojure.lang.Compiler.load (Compiler.java:7064)
    clojure.lang.Compiler.loadFile (Compiler.java:7020)
    clojure.main$load_script.invoke (main.clj:294)
    clojure.main$init_opt.invoke (main.clj:299)
    clojure.main$initialize.invoke (main.clj:327)
    clojure.main$null_opt.invoke (main.clj:362)
    clojure.main$main.doInvoke (main.clj:440)
    clojure.lang.RestFn.invoke (RestFn.java:421)
    clojure.lang.Var.invoke (Var.java:419)
    clojure.lang.AFn.applyToHelper (AFn.java:163)
    clojure.lang.Var.applyTo (Var.java:532)
    clojure.main.main (main.java:37)

Any ideas?

r0man commented 10 years ago

Hi,

I'm not sure what's going on. I had the same error sometimes as well, but couldn't really reproduce what's going on. I just run the tests and got the same error. Twitter says 403 (forbidden).

[roman@bombaclaat oauth-clj]$ lein test

lein test oauth.facebook-test

lein test oauth.google-test

lein test oauth.instagram-test

lein test oauth.io-test

lein test oauth.twitter-test

lein test :only oauth.twitter-test/test-update-status-query-params

ERROR in (test-update-status-query-params) (client.clj:147)
Uncaught exception, not in assertion.
expected: nil
  actual: clojure.lang.ExceptionInfo: clj-http: status 403
 at clj_http.client$wrap_exceptions$fn__1775.invoke (client.clj:147)
clj_http.client$wrap_accept$fn__1922.invoke (client.clj:478)
clj_http.client$wrap_accept_encoding$fn__1928.invoke (client.clj:492)
clj_http.client$wrap_content_type$fn__1917.invoke (client.clj:467)
clj_http.client$wrap_form_params$fn__1968.invoke (client.clj:583)
clj_http.client$wrap_nested_params$fn__1986.invoke (client.clj:607)
clj_http.client$wrap_method$fn__1963.invoke (client.clj:566)

....

Running the tests multiple times after the first error suceeds:

[roman@bombaclaat oauth-clj]$ lein test

lein test oauth.facebook-test

lein test oauth.google-test

lein test oauth.instagram-test

lein test oauth.io-test

lein test oauth.twitter-test

lein test oauth.util-test

lein test oauth.v1-test

lein test oauth.v2-test

Ran 57 tests containing 180 assertions.
0 failures, 0 errors.

At the moment I have no idea what this is.

Roman

canweriotnow commented 10 years ago

Okay, thanks. I'm hacking on a Github oauth component (PR forthcoming), wanted to make sure I wasn't seeing something unique to me. I'll update if I find anything. On Dec 4, 2013 6:13 PM, "r0man" notifications@github.com wrote:

Hi,

I'm not sure what's going on. I had the same error sometimes as well, but couldn't really reproduce what's going on. I just run the tests and got the same error. Twitter says 403 (forbidden).

[roman@bombaclaat oauth-clj]$ lein test

lein test oauth.facebook-test

lein test oauth.google-test

lein test oauth.instagram-test

lein test oauth.io-test

lein test oauth.twitter-test

lein test :only oauth.twitter-test/test-update-status-query-params

ERROR in (test-update-status-query-params) (client.clj:147) Uncaught exception, not in assertion. expected: nil actual: clojure.lang.ExceptionInfo: clj-http: status 403 at clj_http.client$wrap_exceptions$fn1775.invoke (client.clj:147) clj_http.client$wrap_accept$fn1922.invoke (client.clj:478) clj_http.client$wrap_accept_encoding$fn1928.invoke (client.clj:492) clj_http.client$wrap_content_type$fn__1917.invoke (client.clj:467) clj_http.client$wrap_form_params$fn1968.invoke (client.clj:583) clj_http.client$wrap_nested_params$fn1986.invoke (client.clj:607) clj_http.client$wrap_method$fn1963.invoke (client.clj:566)

....

Running the tests multiple times after the first error suceeds:

[roman@bombaclaat oauth-clj]$ lein test

lein test oauth.facebook-test

lein test oauth.google-test

lein test oauth.instagram-test

lein test oauth.io-test

lein test oauth.twitter-test

lein test oauth.util-test

lein test oauth.v1-test

lein test oauth.v2-test

Ran 57 tests containing 180 assertions. 0 failures, 0 errors.

At the moment I have no idea what this is.

Roman

— Reply to this email directly or view it on GitHubhttps://github.com/r0man/oauth-clj/issues/11#issuecomment-29856021 .

canweriotnow commented 10 years ago

Got it... since the status body of test-update-status-query-params and test-update-status-form-params were both (format "Test %s" (java.util.Date.), if both were eval'd at read-time within the same second, a duplicate tweet would be sent, causing the 403 error. Will send PR with fix.

canweriotnow commented 10 years ago

Closing, sent PR with fix in #12