Comments (2)
@bgentry Can you take a look at this one?
It got a little more complicated than I hoped. I believe the intermittency problem is what I described above in the pull request description, but I found when I went to push a fix that I was getting a massively failing test matrix.
Looking into it, that turned out to be because although our time stubs work to a certain extent, they're ignored completely when jobs are being inserted.
I was able to get this fixed up by adding created_at
to inserts with a fall back to now()
, but doing so makes the time stub system a little more elaborate. I tried a number of approaches, and this is the best one I could come up with, but it does change the time stub from a simple function to an interface that can be (1) stubbed, and (2) checked to see if it is stubbed.
It does add a little more code, but all the alternatives I can think of are worse. It's fairly important in specific cases that time be stubbable, and if job insertion always ignores a stub, then it's not really stubbable. I could possibly fix the test by inserting the job and the updating its created_at
with a different query, but that seems pretty bad.
The good news is that we take three different time stub systems (one in limiter_test.go
, the func
approach in riverinternaltest
, and the StubTime
helper in riverinternaltest
), and unify them into a single system.
from river.
Oops, posted that commented on the issue instead of the pull request. Going to delete and post again.
from river.
Related Issues (20)
- InsertManyTx and scheduled_at HOT 7
- ColumnExists query breaks when there are multiple river queues across different schemas HOT 3
- RiverClient Init. Syntax Err HOT 1
- Getting available jobs uses an orphan context which loses important information passing HOT 2
- Cannot test work that inserts jobs using `river.ClientFromContext` HOT 7
- Allow customize context used in Work func with provided key/values in Insert HOT 3
- `FinalizedAt` struct field is not set on `Job` for cancelled events HOT 4
- Version in `go.mod` could be lowered HOT 4
- Background worker always uses public schema HOT 1
- Unable to install the CLI in v0.11.3 HOT 3
- [Feature request] Programatic migration HOT 3
- rivertest examples require internal package HOT 2
- Elector interval field value out of range HOT 8
- docs: riverpro missing line type workflows -> workflow HOT 3
- Graceful shutdown - StopAndCancel panics HOT 3
- [FEATURE REQUEST] Jobs aggregation HOT 6
- [FEATURE REQUEST] Jobs sequential run HOT 4
- [FEATURE REQUEST] provide helper to check if all jobs have been run during tests HOT 2
- Workflow - periodic unique workflow with cancelation HOT 3
- Worker with embeded WorkerDefaults does not implement Worker interface
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from river.