fiftyone.pipeline.engines.fiftyone 4.5.1 → 4.5.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/tests/shareUsage.test.js +16 -4
package/package.json
CHANGED
package/tests/shareUsage.test.js
CHANGED
|
@@ -390,10 +390,22 @@ test('share usage - send more than once', done => {
|
|
|
390
390
|
setTimeout(() => {
|
|
391
391
|
expect(usageEngine.shareData.length).toBe(0);
|
|
392
392
|
expect(received.length).toBe(2);
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
393
|
+
// HTTP requests are asynchronous, so we can't guarantee the order
|
|
394
|
+
// in which they arrive at the server. Check that each UA appears
|
|
395
|
+
// in exactly one message without assuming order.
|
|
396
|
+
const msg1Contains1 = received[0].includes('ua 1');
|
|
397
|
+
const msg1Contains2 = received[0].includes('ua 2');
|
|
398
|
+
const msg2Contains1 = received[1].includes('ua 1');
|
|
399
|
+
const msg2Contains2 = received[1].includes('ua 2');
|
|
400
|
+
// Each message should contain exactly one UA
|
|
401
|
+
expect(msg1Contains1 !== msg1Contains2).toBe(true);
|
|
402
|
+
expect(msg2Contains1 !== msg2Contains2).toBe(true);
|
|
403
|
+
// Both UAs should be present across the two messages
|
|
404
|
+
expect(msg1Contains1 || msg2Contains1).toBe(true);
|
|
405
|
+
expect(msg1Contains2 || msg2Contains2).toBe(true);
|
|
406
|
+
// Each UA should appear in exactly one message
|
|
407
|
+
expect(msg1Contains1 !== msg2Contains1).toBe(true);
|
|
408
|
+
expect(msg1Contains2 !== msg2Contains2).toBe(true);
|
|
397
409
|
done();
|
|
398
410
|
}, 6000);
|
|
399
411
|
});
|