Skip to content

Waiter doesn't error on Timeout #1917

Closed
@trivikr

Description

@trivikr

Describe the bug
Waiter doesn't error on timeout.
It's tested by waiting for a bucket which doesn't exist.

SDK version number
3.3.0

Is the issue in the browser/Node.js/ReactNative?
All

Details of the browser/Node.js/ReactNative version
N/A

To Reproduce (observed behavior)

v2 Code
const AWS = require("aws-sdk");

(async () => {
  const region = "us-west-2";
  const client = new AWS.S3({ region });

  const Bucket = "test-waiters-bucket-does-not-exist";
  await client
    .waitFor("bucketExists", { Bucket, $waiter: { delay: 2, maxAttempts: 3 } })
    .promise();
})();
v2 Output
(node:14350) UnhandledPromiseRejectionWarning: NotFound: Resource is not in the state bucketExists
...
v3 Code
import { S3, waitForBucketExists } from "@aws-sdk/client-s3";

(async () => {
  const region = "us-west-2";
  const client = new S3({ region });

  const Bucket = "test-waiters-bucket-does-not-exist";
  await waitForBucketExists({ client, maxWaitTime: 30 }, { Bucket });
})();
v3 Output
// No output, it should error on timeout.

Expected behavior
Waiter should error on timeout.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugThis issue is a bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions