(t *testing.T)
| 511 | <-finishedC |
| 512 | } |
| 513 | func TestContainerLargeExecArgs(t *testing.T) { |
| 514 | t.Parallel() |
| 515 | |
| 516 | client, err := newClient(t, address) |
| 517 | if err != nil { |
| 518 | t.Fatal(err) |
| 519 | } |
| 520 | defer client.Close() |
| 521 | |
| 522 | var ( |
| 523 | image Image |
| 524 | ctx, cancel = testContext(t) |
| 525 | id = t.Name() |
| 526 | ) |
| 527 | defer cancel() |
| 528 | |
| 529 | image, err = client.GetImage(ctx, testImage) |
| 530 | if err != nil { |
| 531 | t.Fatal(err) |
| 532 | } |
| 533 | |
| 534 | container, err := client.NewContainer(ctx, id, WithNewSnapshot(id, image), WithNewSpec(oci.WithImageConfig(image), longCommand)) |
| 535 | if err != nil { |
| 536 | t.Fatal(err) |
| 537 | } |
| 538 | defer container.Delete(ctx, WithSnapshotCleanup) |
| 539 | |
| 540 | task, err := container.NewTask(ctx, empty()) |
| 541 | if err != nil { |
| 542 | t.Fatal(err) |
| 543 | } |
| 544 | defer task.Delete(ctx) |
| 545 | |
| 546 | finishedC, err := task.Wait(ctx) |
| 547 | if err != nil { |
| 548 | t.Fatal(err) |
| 549 | } |
| 550 | |
| 551 | if err := task.Start(ctx); err != nil { |
| 552 | t.Fatal(err) |
| 553 | } |
| 554 | spec, err := container.Spec(ctx) |
| 555 | if err != nil { |
| 556 | t.Fatal(err) |
| 557 | } |
| 558 | |
| 559 | processSpec := spec.Process |
| 560 | withExecArgs(processSpec, "echo", strings.Repeat("a", 20000)) |
| 561 | execID := t.Name() + "_exec" |
| 562 | process, err := task.Exec(ctx, execID, processSpec, empty()) |
| 563 | if err != nil { |
| 564 | t.Fatal(err) |
| 565 | } |
| 566 | processStatusC, err := process.Wait(ctx) |
| 567 | if err != nil { |
| 568 | t.Fatal(err) |
| 569 | } |
| 570 |
nothing calls this directly
no test coverage detected
searching dependent graphs…