@@ -177,8 +177,7 @@ func TestRFC_postKID(t *testing.T) {
177
177
}))
178
178
defer ts .Close ()
179
179
180
- ctx , cancel := context .WithTimeout (context .Background (), 5 * time .Second )
181
- defer cancel ()
180
+ ctx := context .Background ()
182
181
cl := & Client {
183
182
Key : testKey ,
184
183
DirectoryURL : ts .URL ,
@@ -316,8 +315,7 @@ func TestRFC_Register(t *testing.T) {
316
315
s .start ()
317
316
defer s .close ()
318
317
319
- ctx , cancel := context .WithTimeout (context .Background (), 5 * time .Second )
320
- defer cancel ()
318
+ ctx := context .Background ()
321
319
cl := & Client {
322
320
Key : testKeyEC ,
323
321
DirectoryURL : s .url ("/" ),
@@ -454,8 +452,7 @@ func TestRFC_RegisterExternalAccountBinding(t *testing.T) {
454
452
s .start ()
455
453
defer s .close ()
456
454
457
- ctx , cancel := context .WithTimeout (context .Background (), 5 * time .Second )
458
- defer cancel ()
455
+ ctx := context .Background ()
459
456
cl := & Client {
460
457
Key : testKeyEC ,
461
458
DirectoryURL : s .url ("/" ),
@@ -867,24 +864,13 @@ func testWaitOrderStatus(t *testing.T, okStatus string) {
867
864
s .start ()
868
865
defer s .close ()
869
866
870
- var order * Order
871
- var err error
872
- done := make (chan struct {})
873
- go func () {
874
- cl := & Client {Key : testKeyEC , DirectoryURL : s .url ("/" )}
875
- order , err = cl .WaitOrder (context .Background (), s .url ("/orders/1" ))
876
- close (done )
877
- }()
878
- select {
879
- case <- time .After (3 * time .Second ):
880
- t .Fatal ("WaitOrder took too long to return" )
881
- case <- done :
882
- if err != nil {
883
- t .Fatalf ("WaitOrder: %v" , err )
884
- }
885
- if order .Status != okStatus {
886
- t .Errorf ("order.Status = %q; want %q" , order .Status , okStatus )
887
- }
867
+ cl := & Client {Key : testKeyEC , DirectoryURL : s .url ("/" )}
868
+ order , err := cl .WaitOrder (context .Background (), s .url ("/orders/1" ))
869
+ if err != nil {
870
+ t .Fatalf ("WaitOrder: %v" , err )
871
+ }
872
+ if order .Status != okStatus {
873
+ t .Errorf ("order.Status = %q; want %q" , order .Status , okStatus )
888
874
}
889
875
}
890
876
@@ -909,30 +895,20 @@ func TestRFC_WaitOrderError(t *testing.T) {
909
895
s .start ()
910
896
defer s .close ()
911
897
912
- var err error
913
- done := make (chan struct {})
914
- go func () {
915
- cl := & Client {Key : testKeyEC , DirectoryURL : s .url ("/" )}
916
- _ , err = cl .WaitOrder (context .Background (), s .url ("/orders/1" ))
917
- close (done )
918
- }()
919
- select {
920
- case <- time .After (3 * time .Second ):
921
- t .Fatal ("WaitOrder took too long to return" )
922
- case <- done :
923
- if err == nil {
924
- t .Fatal ("WaitOrder returned nil error" )
925
- }
926
- e , ok := err .(* OrderError )
927
- if ! ok {
928
- t .Fatalf ("err = %v (%T); want OrderError" , err , err )
929
- }
930
- if e .OrderURL != s .url ("/orders/1" ) {
931
- t .Errorf ("e.OrderURL = %q; want %q" , e .OrderURL , s .url ("/orders/1" ))
932
- }
933
- if e .Status != StatusInvalid {
934
- t .Errorf ("e.Status = %q; want %q" , e .Status , StatusInvalid )
935
- }
898
+ cl := & Client {Key : testKeyEC , DirectoryURL : s .url ("/" )}
899
+ _ , err := cl .WaitOrder (context .Background (), s .url ("/orders/1" ))
900
+ if err == nil {
901
+ t .Fatal ("WaitOrder returned nil error" )
902
+ }
903
+ e , ok := err .(* OrderError )
904
+ if ! ok {
905
+ t .Fatalf ("err = %v (%T); want OrderError" , err , err )
906
+ }
907
+ if e .OrderURL != s .url ("/orders/1" ) {
908
+ t .Errorf ("e.OrderURL = %q; want %q" , e .OrderURL , s .url ("/orders/1" ))
909
+ }
910
+ if e .Status != StatusInvalid {
911
+ t .Errorf ("e.Status = %q; want %q" , e .Status , StatusInvalid )
936
912
}
937
913
}
938
914
@@ -972,8 +948,7 @@ func TestRFC_CreateOrderCert(t *testing.T) {
972
948
})
973
949
s .start ()
974
950
defer s .close ()
975
- ctx , cancel := context .WithTimeout (context .Background (), 3 * time .Second )
976
- defer cancel ()
951
+ ctx := context .Background ()
977
952
978
953
cl := & Client {Key : testKeyEC , DirectoryURL : s .url ("/" )}
979
954
cert , curl , err := cl .CreateOrderCert (ctx , s .url ("/pleaseissue" ), csr , true )
0 commit comments