Skip to content

fix: MultiAZ failover2 failing integration tests#458

Merged
joyc-bq merged 8 commits intomainfrom
multiaz-failover2
May 17, 2025
Merged

fix: MultiAZ failover2 failing integration tests#458
joyc-bq merged 8 commits intomainfrom
multiaz-failover2

Conversation

@joyc-bq
Copy link
Copy Markdown
Contributor

@joyc-bq joyc-bq commented May 16, 2025

Summary

fixes failover2 failed error:

  FAIL tests/integration/container/tests/aurora_failover2.test.ts (1162.291 s)
      aurora failover2
        ✓ fails from writer to new writer on connection invocation (347821 ms)
        ✕ writer fails within transaction (637604 ms)
        ✓ fails from writer and transfers session state (175691 ms)
        ○ skipped fails from reader to writer

      ● aurora failover2 › writer fails within transaction

        expect(received).rejects.toThrow(expected)

        Expected constructor: TransactionResolutionUnknownError
        Received constructor: FailoverFailedError

        Received message: "The new writer was identified to be 'test-mysql-240316811463-instance-2.ct2yais8ma2o.***.rds.amazonaws.com', but querying the instance for its role returned a reader."

              490 |     logger.error(errorMessage);
              491 |     this.failoverWriterFailedCounter.inc();
            > 492 |     throw new FailoverFailedError(errorMessage);
                  |           ^
              493 |   }
              494 |
              495 |   async releaseResources(): Promise<void> {

          at Failover2Plugin.logAndThrowError (common/lib/plugins/failover2/failover2_plugin.ts:492:11)
          at common/lib/plugins/failover2/failover2_plugin.ts:420:16
  

fixes connect timeout error for multiaz:

### Description
  FAIL tests/integration/container/tests/basic_connectivity.test.ts (143.008 s)
      basic_connectivity
        ✕ wrapper with failover plugins read only endpoint (14836 ms)
        ✓ wrapper with failover plugins cluster endpoint (2383 ms)
        ✓ wrapper with failover plugins instance endpoint (1865 ms)
        ✓ wrapper (1156 ms)
        ✓ wrapper_proxy (121640 ms)

      ● basic_connectivity › wrapper with failover plugins read only endpoint

        connect ETIMEDOUT

          41 |     this.setKeepAliveProperties(driverProperties, props.get(WrapperProperties.KEEPALIVE_PROPERTIES.name));
          42 |     this.setConnectTimeout(driverProperties, props.get(WrapperProperties.WRAPPER_CONNECT_TIMEOUT.name));
        > 43 |     const targetClient = await createConnection(Object.fromEntries(driverProperties.entries()));
             |                                ^
          44 |     return Promise.resolve(new MySQLClientWrapper(targetClient, hostInfo, props, this));
          45 |   }
          46 |

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Comment thread common/lib/plugins/failover2/failover2_plugin.ts Outdated
Comment thread tests/integration/container/tests/basic_connectivity.test.ts
@joyc-bq joyc-bq marked this pull request as ready for review May 17, 2025 01:29
@joyc-bq joyc-bq requested a review from a team as a code owner May 17, 2025 01:29
@joyc-bq joyc-bq merged commit ca9564c into main May 17, 2025
2 checks passed
@joyc-bq joyc-bq deleted the multiaz-failover2 branch May 17, 2025 01:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants