Skip to content

[Framework] Add flow tests#73

Merged
TomerShor merged 2 commits intov3io:developmentfrom
weilerN:nuc-455-add-flow-tests
Jun 29, 2025
Merged

[Framework] Add flow tests#73
TomerShor merged 2 commits intov3io:developmentfrom
weilerN:nuc-455-add-flow-tests

Conversation

@weilerN
Copy link
Collaborator

@weilerN weilerN commented Jun 25, 2025

This PR adds unit tests for the flow described in the related Jira ticket: https://iguazio.atlassian.net/browse/NUC-455 .
The tests ensure coverage of the newly implemented logic and validate its behavior under expected conditions.

In addition, this PR includes test coverage for the changes introduced in v3io/scaler#72, providing verification for that logic as well.

The unit tests failure are fixed in a separated PR - #72

@weilerN weilerN requested review from TomerShor and rokatyy June 25, 2025 11:31
@weilerN weilerN force-pushed the nuc-455-add-flow-tests branch from b0b5fb3 to e668aa4 Compare June 25, 2025 15:59
TomerShor pushed a commit that referenced this pull request Jun 25, 2025
…tions (#72)

### **Motivation**  
Described in the jira - https://iguazio.atlassian.net/browse/NUC-494

### **Root Cause**  
The problem happens when multiple goroutines run `Load()` →
`NewSafeTrie()` → `Store()` at the same time. Each one might create its
own trie, and since Store() always overwrites the value, one goroutine
can replace the result of another—causing entries to be lost.

### **Description**  
Replace `Load/Store` pattern with the atomic `LoadOrStore()` to ensure
only one goroutine creates the initial trie per host.

### **Affected Areas**  
No affected areas, internal package changes only

### **Testing**  
- As outlined in the Jira ticket, parallel tests targeting race
conditions will be introduced in a separate code review -
#73

### **Changes Made**  
- Changed the way the cache create an initial trie
@weilerN weilerN force-pushed the nuc-455-add-flow-tests branch from e668aa4 to ad3f0b1 Compare June 26, 2025 06:01
@weilerN weilerN marked this pull request as ready for review June 26, 2025 06:11
@weilerN weilerN requested a review from TomerShor June 26, 2025 13:44
Copy link
Collaborator

@rokatyy rokatyy left a comment

Choose a reason for hiding this comment

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

Nice!

@TomerShor TomerShor merged commit a5531d1 into v3io:development Jun 29, 2025
3 checks passed
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.

3 participants