Skip to content

Use synctest instead of fakeclock in tests#586

Merged
jbsv merged 8 commits into
masterfrom
dkg/synctest
Mar 17, 2026
Merged

Use synctest instead of fakeclock in tests#586
jbsv merged 8 commits into
masterfrom
dkg/synctest

Conversation

@AnomalRoil

Copy link
Copy Markdown
Contributor

This is a newly added feature of Go 1.25: synctest allows to use the time package like one would in real life, and have a special synctest bubble in which tests are run where synchronization of goroutine can be ensured by calling synctest.Wait() after a time.Sleep() has been called, e.g.

It also will warn about deadlock caused by time.Sleep and such in go routines.

@github-actions

Copy link
Copy Markdown

🔒 Could not start CI tests due to missing safe PR label. Please contact a DEDIS maintainer.

1 similar comment
@github-actions

Copy link
Copy Markdown

🔒 Could not start CI tests due to missing safe PR label. Please contact a DEDIS maintainer.

@AnomalRoil

Copy link
Copy Markdown
Contributor Author

This is weird, I would expect it to pickup my new github workflow file that specifies go 1.25 but it seems it keeps using the old values weirdly.

@pierluca

Copy link
Copy Markdown
Contributor

Yes, it's designed to use the repo's GitHub actions.
Can you split this PR into one to update the workflows and the other for dkg/synctest ?
It'll be easiest to get this merged.
Had a quick look, LGTM 👍

@jbsv

jbsv commented Nov 26, 2025

Copy link
Copy Markdown
Contributor

go 1.25 and golangci-lint setup are already part of the int32-reviewed branch that should be merged to master soon-ish.

AnomalRoil and others added 4 commits February 23, 2026 15:40
Signed-off-by: Yolan Romailler <AnomalRoil@users.noreply.github.com>
Signed-off-by: Yolan Romailler <AnomalRoil@users.noreply.github.com>
@sonarqubecloud

sonarqubecloud Bot commented Mar 2, 2026

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
15.2% Duplication on New Code (required ≤ 10%)

See analysis details on SonarQube Cloud

@jbsv

jbsv commented Mar 9, 2026

Copy link
Copy Markdown
Contributor

Hi @AnomalRoil , is it ok to have a little bit of duplication in test code ? Should we proceed to merge this work within the master branch now ?

@AnomalRoil

Copy link
Copy Markdown
Contributor Author

@jbsv IMO yes, and I didn't add duplicate code, it's just I touched existing one and so it triggers SonarCloud analysis on it...

@jbsv jbsv left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@jbsv
jbsv merged commit 147850f into master Mar 17, 2026
24 of 25 checks passed
@jbsv
jbsv deleted the dkg/synctest branch March 17, 2026 10:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants