Skip to content

Adds a non-repeating scheduled reducer test#3233

Open
rekhoff wants to merge 11 commits intomasterfrom
rekhoff/nonrepeating-scheduled-reducer-test
Open

Adds a non-repeating scheduled reducer test#3233
rekhoff wants to merge 11 commits intomasterfrom
rekhoff/nonrepeating-scheduled-reducer-test

Conversation

@rekhoff
Copy link
Copy Markdown
Contributor

@rekhoff rekhoff commented Sep 5, 2025

Description of Changes

Adds a non-repeating scheduled reducer integration test to the existing Rust and C# integration tests, in order to address #3213

API and ABI breaking changes

No

Expected complexity level and risk

1

Testing

  • Ran cargo test -p spacetimedb-testing and all tests passed

@rekhoff rekhoff self-assigned this Sep 5, 2025
@rekhoff rekhoff requested a review from jdetter September 8, 2025 19:18
@jdetter jdetter marked this pull request as ready for review September 9, 2025 17:29
Comment thread modules/module-test-cs/Lib.cs Outdated
public static void nonrepeating_test(ReducerContext ctx, NonrepeatingTestArg arg)
{
var deltaTime = ctx.Timestamp.TimeDurationSince(arg.prev_time);
Log.Trace($"Timestamp: {ctx.Timestamp}, Delta time: {deltaTime}");
Copy link
Copy Markdown
Collaborator

@jdetter jdetter Sep 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where in the test harness do we actually check to see if we get this log? If this log isn't present how does the test fail?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update made with new tests actually being executed (in crates/testing/tests/standalone_integration_test.rs).
I've also ensured the tests run in Rust / C# / Typescript. The PR description has been updated with more details on these changes as well.

.timestamp
.duration_since(arg.prev_time)
.expect("arg.prev_time is later than ctx.timestamp... huh?");
log::trace!(
Copy link
Copy Markdown
Collaborator

@jdetter jdetter Sep 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here: Where in the test harness do we actually check to see if we get this log? If this log isn't present how does the test fail?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right, I don't believe those tests had ran as part of CI. They should now be run along side the other tests in crates/testing/tests/standalone_integration_test.rs

Copy link
Copy Markdown
Collaborator

@jdetter jdetter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few Qs on this

@bfops bfops added release-any To be landed in any release window no runtime change This change does not affect the final binaries labels Sep 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no runtime change This change does not affect the final binaries possibly-stale release-any To be landed in any release window

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants