@@ -1079,7 +1079,7 @@ func TestStartContainerWithContext(t *testing.T) {
1079
1079
1080
1080
startError := make (chan error )
1081
1081
go func () {
1082
- startError <- client .StartContainerWithContext (id , & HostConfig {}, ctx )
1082
+ startError <- client .StartContainerWithContext (ctx , id , & HostConfig {})
1083
1083
}()
1084
1084
select {
1085
1085
case err := <- startError :
@@ -1154,7 +1154,7 @@ func TestStopContainerWithContext(t *testing.T) {
1154
1154
1155
1155
stopError := make (chan error )
1156
1156
go func () {
1157
- stopError <- client .StopContainerWithContext (id , 10 , ctx )
1157
+ stopError <- client .StopContainerWithContext (ctx , id , 10 )
1158
1158
}()
1159
1159
select {
1160
1160
case err := <- stopError :
@@ -2473,7 +2473,8 @@ func TestStats(t *testing.T) {
2473
2473
"total_usage" : 36488948,
2474
2474
"usage_in_kernelmode" : 20000000
2475
2475
},
2476
- "system_cpu_usage" : 20091722000000000
2476
+ "system_cpu_usage" : 20091722000000000,
2477
+ "online_cpus": 4
2477
2478
},
2478
2479
"precpu_stats" : {
2479
2480
"cpu_usage" : {
@@ -2487,7 +2488,8 @@ func TestStats(t *testing.T) {
2487
2488
"total_usage" : 36488948,
2488
2489
"usage_in_kernelmode" : 20000000
2489
2490
},
2490
- "system_cpu_usage" : 20091722000000000
2491
+ "system_cpu_usage" : 20091722000000000,
2492
+ "online_cpus": 4
2491
2493
}
2492
2494
}`
2493
2495
// 1 second later, cache is 100
@@ -2591,7 +2593,8 @@ func TestStats(t *testing.T) {
2591
2593
"total_usage" : 36488948,
2592
2594
"usage_in_kernelmode" : 20000000
2593
2595
},
2594
- "system_cpu_usage" : 20091722000000000
2596
+ "system_cpu_usage" : 20091722000000000,
2597
+ "online_cpus": 4
2595
2598
},
2596
2599
"precpu_stats" : {
2597
2600
"cpu_usage" : {
@@ -2605,7 +2608,8 @@ func TestStats(t *testing.T) {
2605
2608
"total_usage" : 36488948,
2606
2609
"usage_in_kernelmode" : 20000000
2607
2610
},
2608
- "system_cpu_usage" : 20091722000000000
2611
+ "system_cpu_usage" : 20091722000000000,
2612
+ "online_cpus": 4
2609
2613
}
2610
2614
}`
2611
2615
var expected1 Stats
@@ -2725,7 +2729,7 @@ func TestInspectContainerWhenContextTimesOut(t *testing.T) {
2725
2729
ctx , cancel := context .WithTimeout (context .TODO (), 100 * time .Millisecond )
2726
2730
defer cancel ()
2727
2731
2728
- _ , err := client .InspectContainerWithContext ("id" , ctx )
2732
+ _ , err := client .InspectContainerWithContext (ctx , "id" )
2729
2733
if err != context .DeadlineExceeded {
2730
2734
t .Errorf ("Expected 'DeadlineExceededError', got: %v" , err )
2731
2735
}
@@ -2740,7 +2744,7 @@ func TestStartContainerWhenContextTimesOut(t *testing.T) {
2740
2744
ctx , cancel := context .WithTimeout (context .TODO (), 100 * time .Millisecond )
2741
2745
defer cancel ()
2742
2746
2743
- err := client .StartContainerWithContext ("id" , nil , ctx )
2747
+ err := client .StartContainerWithContext (ctx , "id" , nil )
2744
2748
if err != context .DeadlineExceeded {
2745
2749
t .Errorf ("Expected 'DeadlineExceededError', got: %v" , err )
2746
2750
}
@@ -2755,7 +2759,7 @@ func TestStopContainerWhenContextTimesOut(t *testing.T) {
2755
2759
ctx , cancel := context .WithTimeout (context .TODO (), 50 * time .Millisecond )
2756
2760
defer cancel ()
2757
2761
2758
- err := client .StopContainerWithContext ("id" , 10 , ctx )
2762
+ err := client .StopContainerWithContext (ctx , "id" , 10 )
2759
2763
if err != context .DeadlineExceeded {
2760
2764
t .Errorf ("Expected 'DeadlineExceededError', got: %v" , err )
2761
2765
}
0 commit comments