Commit Graph

12 Commits

Author SHA1 Message Date
Kim Altintop f458d418e5 smoketests: Adjust test_enable_disable_replication test (#3822)
This now can't rely on `replication_state` before enabling replication.
2025-12-04 18:55:38 +00:00
Kim Altintop e331b2f0e5 smoketests: Adjust enable replication tests (#3590)
Enabling replication now requires the database to be suspended.
Adjust the tests to account for that.
2025-11-07 05:17:39 +00:00
Noa 18af6c46ad Fix some annoyances with the smoketests (#3556)
# Description of Changes

Now running `python -m smoketests` no longer updates
`smoketests/config.toml` with a new identity, and also `replication`
doesn't fail when docker isn't available.

# Expected complexity level and risk

1

# Testing

- [x] those things no longer happen

---------

Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
2025-11-05 17:07:35 +00:00
Phoebe Goldman ee19a567ef Set default server to local in replication smoketests (#3562)
Discussion out-of-band.

---------

Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
Co-authored-by: Zeke Foppa <196249+bfops@users.noreply.github.com>
2025-11-05 03:57:51 +00:00
Kim Altintop 321e4302ef smoketests: Smoketest enable replication for existing database (#3138)
Adds a (basic) smoketest that shows that we can enable, disable and
enable again replication on an existing, non-replicated database.
2025-09-18 07:21:22 +00:00
Kim Altintop f394de32d9 Confirmed reads (#3133)
# Description of Changes

Implements [subscribing to durable
commits](https://github.com/clockworklabs/SpacetimeDBPrivate/issues/1594).

The setting works on a per-connection level, and essentially just delays
sending transaction updates until the transaction is reported as durable
by the database.

For connectionless SQL operations, the setting works per-request. No SQL
syntax is provided by this patch to toggle the configuration.

After some deliberation, I opted to obtain the offset when a transaction
commits (as opposed to when it starts). This creates some mild
inconvenience, because we prevent the transaction from committing until
the corresponding subscription updates are enqueued.
The strategy is, however, more correct should we ever support weaker
isolation levels, and it is easier to document.

Follow-ups include:

- Provide SQL syntax (`SET synchronous_commit = ON` or something)
- C# and TypeScript SDKs
- Reference docs?
 

# API and ABI breaking changes

Not breaking, but adds a parameter to the subscribe and sql endpoints.


# Expected complexity level and risk

4

To the author's understanding, ordering of outbound messages is not
changed by this patch, even if there are messages that don't have a
transaction offset (such as error messages). I.e. while waiting for the
transaction offset of a message to become durable, no message enqueued
after that message will be delivered. This may not be desirable in some
cases.

The patch may contain concurrency bugs, e.g. awaiting futures that may
never resolve.


# Testing

- [x] Implemented a new test in the `module_subscription_actor` module
- [x] Added unit tests for the core logic in `ClientConnectionReceiver` 

It would be desirable to also have integration-level tests, but I'm
currently unsure how to write those without being able to control if and
when the database reports an offset as durable.

---------

Signed-off-by: Kim Altintop <kim@eagain.io>
Co-authored-by: Phoebe Goldman <phoebe@clockworklabs.io>
2025-09-08 17:51:04 +00:00
Zeke Foppa 86089e338f Smoketests can run against remote servers (#3012)
# Description of Changes

This enables smoketests to run against remote servers, such as maincloud
/ maincloud staging.

I also added a `--spacetime-login` param, for servers that require a
"proper" spacetime login (such as both servers above).

Usage:
```bash
python3 -m smoketests \
  --remote-server https://maincloud.staging.spacetimedb.com \
  --spacetime-login \
  -x replication # for some reason this is required, even though I swear it should be disabled by not passing `--docker`
```

# API and ABI breaking changes

None. CI only.

# Expected complexity level and risk

1

# Testing
- [x] Smoketests pass on this PR
- [x] Smoketests pass when run against maincloud staging (using the
instructions above)
- [x] Manual review to check whether I've accidentally de-fanged any
"test for negative case" tests

---------

Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
2025-08-22 17:13:42 +00:00
Kim Altintop 84edd8779f smoktests: Wait for batched consensus (#3010)
Until we have confirmed reads, we need to wait for a tick until any
batched commits are flushed.

Also cleaned up the code a bit to do less string manipulation of sql
results all over the place, and to output less irrelevant logging.

# Expected complexity level and risk

1

# Testing

- [x] yes
2025-08-01 13:04:26 +00:00
Kim Altintop 42905000ca smoketests: Adjust for node table rename (#2970) 2025-07-23 12:17:08 +00:00
Kim Altintop c43d8fe1a1 smoketest: Retry if there is no current leader (#2950) 2025-07-21 11:39:52 +00:00
Kim Altintop 1c65d7bc22 smoketests: Bring containers back up in tear down of replication tests (#2818) 2025-06-02 08:19:22 +00:00
Kim Altintop 7f0502ecf7 Replication Smoketest Cleanups (#2675)
Co-authored-by: Shubham Mishra <shubham@clockworklabs.io>
Co-authored-by: Shubham Mishra <shivam828787@gmail.com>
2025-04-28 11:39:07 +00:00