@@ -17,7 +17,9 @@ export function assertValidTimeouts(expectedCount: number): void {
1717 for ( const [ lang , state ] of Object . entries ( timeoutState ) ) {
1818 let numberOfTestSuites = 1 ;
1919
20- if ( lang === 'python' ) {
20+ // composition api is also testing the retry strategy in JS
21+ // python has sync and async tests
22+ if ( lang === 'python' || lang === 'javascript' ) {
2123 numberOfTestSuites = 2 ;
2224 }
2325
@@ -26,23 +28,23 @@ export function assertValidTimeouts(expectedCount: number): void {
2628 expect ( state . duration . length ) . to . equal ( 3 * numberOfTestSuites ) ;
2729
2830 for ( let i = 0 ; i < numberOfTestSuites ; i ++ ) {
29- expect ( state . timestamp [ 3 * i + 1 ] - state . timestamp [ 3 * i ] ) . to . be . closeTo ( state . duration [ 3 * i ] , 100 ) ;
30- expect ( state . timestamp [ 3 * i + 2 ] - state . timestamp [ 3 * i + 1 ] ) . to . be . closeTo ( state . duration [ 3 * i + 1 ] , 100 ) ;
31+ expect ( state . timestamp [ 3 * i + 1 ] - state . timestamp [ 3 * i ] ) . to . be . closeTo ( state . duration [ 3 * i ] , 400 ) ;
32+ expect ( state . timestamp [ 3 * i + 2 ] - state . timestamp [ 3 * i + 1 ] ) . to . be . closeTo ( state . duration [ 3 * i + 1 ] , 400 ) ;
3133
3234 // languages are not consistent yet for the delay between requests
3335 switch ( lang ) {
3436 case 'javascript' :
3537 expect ( state . duration [ 3 * i ] * 4 ) . to . be . closeTo ( state . duration [ 3 * i + 1 ] , 300 ) ;
3638 break ;
3739 case 'php' :
38- expect ( state . duration [ 3 * i ] * 2 ) . to . be . closeTo ( state . duration [ 3 * i + 1 ] , 200 ) ;
40+ expect ( state . duration [ 3 * i ] * 2 ) . to . be . closeTo ( state . duration [ 3 * i + 1 ] , 300 ) ;
3941 break ;
4042 case 'swift' :
4143 expect ( state . duration [ 3 * i ] ) . to . be . closeTo ( state . duration [ 3 * i + 1 ] , 800 ) ;
4244 break ;
4345 default :
4446 // the delay should be the same, because the `retryCount` is per host instead of global
45- expect ( state . duration [ 3 * i ] ) . to . be . closeTo ( state . duration [ 3 * i + 1 ] , 150 ) ;
47+ expect ( state . duration [ 3 * i ] ) . to . be . closeTo ( state . duration [ 3 * i + 1 ] , 300 ) ;
4648 break ;
4749 }
4850 }
0 commit comments